First, load the required R packages:
# Setup----
library(tidyverse)
## Warning: package 'readr' was built under R version 4.3.2
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.2 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)
library(data.table)
##
## Attaching package: 'data.table'
##
## The following objects are masked from 'package:lubridate':
##
## hour, isoweek, mday, minute, month, quarter, second, wday, week,
## yday, year
##
## The following objects are masked from 'package:dplyr':
##
## between, first, last
##
## The following object is masked from 'package:purrr':
##
## transpose
library(glmmTMB) # For generalized linear mixed models
library(gllvm)
## Loading required package: TMB
## Loading required package: mvabund
##
## Attaching package: 'gllvm'
##
## The following object is masked from 'package:mvabund':
##
## coefplot
##
## The following object is masked from 'package:stats':
##
## simulate
library(jtools)
library(sf)
## Linking to GEOS 3.11.1, GDAL 3.6.2, PROJ 9.1.1; sf_use_s2() is TRUE
library(raster)
## Loading required package: sp
##
## Attaching package: 'raster'
##
## The following object is masked from 'package:dplyr':
##
## select
library(interactions) # For interaction plots
library(glmmTMB) # For generalized linear mixed models
library(broom.mixed) # easily extract model coefficients
## Registered S3 methods overwritten by 'broom':
## method from
## tidy.glht jtools
## tidy.summary.glht jtools
library(extrafont)
## Registering fonts with R
library(Cairo) # Export as vector pdf
library(emmeans) # For pairwise comparison among factor levels
library(DHARMa) # Examining GLMM model fit
## This is DHARMa 0.4.6. For overview type '?DHARMa'. For recent changes, type news(package = 'DHARMa')
Sys.setlocale("LC_ALL", "Hebrew") # For reading and writing csv files with Hebrew
## Warning in Sys.setlocale("LC_ALL", "Hebrew"): using locale code page other than
## 65001 ("UTF-8") may cause problems
## [1] "LC_COLLATE=Hebrew_Israel.1255;LC_CTYPE=Hebrew_Israel.1255;LC_MONETARY=Hebrew_Israel.1255;LC_NUMERIC=C;LC_TIME=Hebrew_Israel.1255"
# knitr::opts_knit$set(root.dir = 'C:/Users/User/OneDrive - Tel-Aviv University/Maarag/State of Nature Report/2023/Reptiles') # Change this to your file path
okabe <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7", 'red')
If need be, register the fonts (only once per computer):
# loadfonts()
Define the standards (font, output size and reverse Hebrew text) for graphical output:
fontname = "Almoni ML v5 AAA"
fontsize=22
pdf_width=160
pdf_aspect_ratio = 2/3
strReverse <- function(x){sapply(lapply(strsplit(x, NULL), rev), paste, collapse="")} # To reverse the order of (Hebrew) text for export as vector pdf
Load the raw reptile data:
# Load the data----
# setwd('C:/Users/User/OneDrive - Tel-Aviv University/Maarag/State of Nature Report/2023/Reptiles') # Change this to your file path
reptiles.raw <- fread('data/2023-04-19_all_rept_data.csv')
reptiles <- copy(reptiles.raw)
reptiles
## campaign year unit subunit site
## 1: T2 2017 Planted Conifer Forests Galilee Manara
## 2: T2 2017 Planted Conifer Forests Galilee Manara
## 3: T2 2017 Planted Conifer Forests Galilee Manara
## 4: T2 2017 Planted Conifer Forests Galilee Manara
## 5: T2 2017 Planted Conifer Forests Galilee Ramot Naftali
## ---
## 2767: T1 2015 Coastal Plain Sands <NA> Zikim
## 2768: T1 2015 Coastal Plain Sands <NA> Zikim
## 2769: T1 2015 Coastal Plain Sands <NA> Zikim
## 2770: T0 2014 Mediterranean-Desert Transition Zone <NA> Lehavim
## 2771: T0 2014 Mediterranean-Desert Transition Zone <NA> Lehavim
## point_name settlements agriculture habitat dunes
## 1: Manara KKL Plantings 2 <NA> <NA> <NA> <NA>
## 2: Manara KKL Plantings 3 <NA> <NA> <NA> <NA>
## 3: Manara KKL Plantings 3 <NA> <NA> <NA> <NA>
## 4: Manara KKL Plantings 3 <NA> <NA> <NA> <NA>
## 5: Ramot Naftali KKL Plantings 1 <NA> <NA> <NA> <NA>
## ---
## 2767: Far Shifting 3 Far <NA> <NA> shifting
## 2768: Far Shifting 2 Far <NA> <NA> shifting
## 2769: Far Shifting 2 Far <NA> <NA> shifting
## 2770: Lehavim Near 1 Near <NA> <NA> <NA>
## 2771: Lehavim Near 6 Near <NA> <NA> <NA>
## observations_id latitude longitude date time date_end time_end
## 1: 33.17319 35.55109 26/04/2017 13:51:00
## 2: 33.17772 35.54867 26/04/2017 14:46:00
## 3: 33.17772 35.54867 26/04/2017 14:46:00
## 4: 33.17772 35.54867 26/04/2017 14:46:00
## 5: 33.09474 35.56141 26/04/2017 16:12:00
## ---
## 2767: 31.61857 34.51235 23/10/2015 8:03:00
## 2768: 31.61447 34.50955 23/10/2015 7:34:00
## 2769: 31.61447 34.50955 23/10/2015 7:34:00
## 2770: NA NA 24/04/2014 10:50:00
## 2771: NA NA 24/04/2014 11:23:00
## activity orientation type body tail tail_type
## 1: moving near <NA> NA <NA> original
## 2: shelter under <NA> NA <NA> broken
## 3: moving near <NA> NA <NA> original
## 4: shelter under <NA> NA <NA> original
## 5: shelter under <NA> NA <NA> regenerated
## ---
## 2767: tracks <NA> <NA> NA <NA> <NA>
## 2768: tracks <NA> <NA> NA <NA> <NA>
## 2769: tracks <NA> <NA> NA <NA> <NA>
## 2770: remains on ground NA <NA> <NA>
## 2771: feces on rock NA <NA> <NA>
## SciName stones_flipped weather temp_shade temp_sun
## 1: Ophisops elegans 36 חם ויבש 27.8 38
## 2: Ablepharus rueppellii 40 חם ויבש 29.0 38
## 3: Ophisops elegans 40 חם ויבש 29.0 38
## 4: Ablepharus rueppellii 40 חם ויבש 29.0 38
## 5: Ablepharus rueppellii 130 חם ויבש 29.6 42
## ---
## 2767: Lytorhynchus diadema NA NA NA
## 2768: Stenodactylus sthenodactylus NA NA NA
## 2769: Spalerosophis diadema NA NA NA
## 2770: Testudo graeca NA <NA> NA NA
## 2771: Laudakia vulgaris NA <NA> NA NA
## site_description obs_snout_len obs_tail_len
## 1: גזם אורנים מתים טרם פונה. נבירות חזירי בר NA NA
## 2: <NA> NA NA
## 3: <NA> NA NA
## 4: <NA> NA NA
## 5: הפרעת רעיה בשטח NA NA
## ---
## 2767: NA NA
## 2768: NA NA
## 2769: NA NA
## 2770: <NA> NA NA
## 2771: <NA> NA NA
## obs_regentail_len material obs_notes disturbance sv
## 1: NA shrub קרחת יער שביל אש עם לוטם שעיר <NA> NA
## 2: NA rock <NA> <NA> NA
## 3: NA annuals <NA> <NA> NA
## 4: NA rock <NA> <NA> NA
## 5: NA rock <NA> <NA> NA
## ---
## 2767: NA NA
## 2768: NA NA
## 2769: NA NA
## 2770: NA <NA> <NA> <NA> NA
## 2771: NA <NA> <NA> <NA> NA
## t regen_t substrate survey_protocol count_individuals weather_desc wind
## 1: NA NA <NA> scan 1 dry <NA>
## 2: NA NA <NA> scan 1 dry <NA>
## 3: NA NA <NA> scan 1 dry <NA>
## 4: NA NA <NA> scan 1 dry <NA>
## 5: NA NA <NA> scan 1 dry <NA>
## ---
## 2767: NA NA trail 3
## 2768: NA NA trail 2
## 2769: NA NA trail 1
## 2770: NA NA <NA> scan 1 <NA> <NA>
## 2771: NA NA <NA> scan 1 <NA> <NA>
## sex_new age observation_type Column
## 1: female <NA> direct <NA>
## 2: <NA> adult direct <NA>
## 3: male <NA> direct <NA>
## 4: <NA> adult direct <NA>
## 5: <NA> adult direct <NA>
## ---
## 2767: indirect <NA>
## 2768: indirect <NA>
## 2769: indirect <NA>
## 2770: <NA> <NA> indirect <NA>
## 2771: <NA> <NA> indirect <NA>
The goal of the following code chunk is to find and correct problems with the data (e.g. missing data, errors etc.).
# Data wrangling----
# setwd('C:/Users/User/OneDrive - Tel-Aviv University/Maarag/State of Nature Report/2023/Reptiles') # Change this to your file path
str(reptiles)
## Classes 'data.table' and 'data.frame': 2771 obs. of 47 variables:
## $ campaign : chr "T2" "T2" "T2" "T2" ...
## $ year : int 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 ...
## $ unit : chr "Planted Conifer Forests" "Planted Conifer Forests" "Planted Conifer Forests" "Planted Conifer Forests" ...
## $ subunit : chr "Galilee" "Galilee" "Galilee" "Galilee" ...
## $ site : chr "Manara" "Manara" "Manara" "Manara" ...
## $ point_name : chr "Manara KKL Plantings 2" "Manara KKL Plantings 3" "Manara KKL Plantings 3" "Manara KKL Plantings 3" ...
## $ settlements : chr NA NA NA NA ...
## $ agriculture : chr NA NA NA NA ...
## $ habitat : chr NA NA NA NA ...
## $ dunes : chr NA NA NA NA ...
## $ observations_id : chr "" "" "" "" ...
## $ latitude : num 33.2 33.2 33.2 33.2 33.1 ...
## $ longitude : num 35.6 35.5 35.5 35.5 35.6 ...
## $ date : chr "26/04/2017" "26/04/2017" "26/04/2017" "26/04/2017" ...
## $ time : chr "13:51:00" "14:46:00" "14:46:00" "14:46:00" ...
## $ date_end : chr "" "" "" "" ...
## $ time_end : chr "" "" "" "" ...
## $ activity : chr "moving" "shelter" "moving" "shelter" ...
## $ orientation : chr "near" "under" "near" "under" ...
## $ type : chr NA NA NA NA ...
## $ body : int NA NA NA NA NA NA NA NA NA NA ...
## $ tail : chr NA NA NA NA ...
## $ tail_type : chr "original" "broken" "original" "original" ...
## $ SciName : chr "Ophisops elegans" "Ablepharus rueppellii" "Ophisops elegans" "Ablepharus rueppellii" ...
## $ stones_flipped : int 36 40 40 40 130 100 100 80 80 80 ...
## $ weather : chr "חם ויבש" "חם ויבש" "חם ויבש" "חם ויבש" ...
## $ temp_shade : num 27.8 29 29 29 29.6 27 27 26.3 26.3 26.3 ...
## $ temp_sun : num 38 38 38 38 42 29.1 29.1 31 31 31 ...
## $ site_description : chr "גזם אורנים מתים טרם פונה. נבירות חזירי בר" NA NA NA ...
## $ obs_snout_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ obs_tail_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ obs_regentail_len: int NA NA NA NA NA NA NA NA NA NA ...
## $ material : chr "shrub" "rock" "annuals" "rock" ...
## $ obs_notes : chr "קרחת יער שביל אש עם לוטם שעיר" NA NA NA ...
## $ disturbance : chr NA NA NA NA ...
## $ sv : int NA NA NA NA NA NA NA NA NA NA ...
## $ t : int NA NA NA NA NA NA NA NA NA NA ...
## $ regen_t : num NA NA NA NA NA NA NA NA NA NA ...
## $ substrate : chr NA NA NA NA ...
## $ survey_protocol : chr "scan" "scan" "scan" "scan" ...
## $ count_individuals: int 1 1 1 1 1 1 1 1 1 1 ...
## $ weather_desc : chr "dry" "dry" "dry" "dry" ...
## $ wind : chr NA NA NA NA ...
## $ sex_new : chr "female" NA "male" NA ...
## $ age : chr NA "adult" NA "adult" ...
## $ observation_type : chr "direct" "direct" "direct" "direct" ...
## $ Column : chr NA NA NA NA ...
## - attr(*, ".internal.selfref")=<externalptr>
summary(reptiles)
## campaign year unit subunit
## Length:2771 Min. :2013 Length:2771 Length:2771
## Class :character 1st Qu.:2016 Class :character Class :character
## Mode :character Median :2017 Mode :character Mode :character
## Mean :2018
## 3rd Qu.:2019
## Max. :2021
##
## site point_name settlements agriculture
## Length:2771 Length:2771 Length:2771 Length:2771
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## habitat dunes observations_id latitude
## Length:2771 Length:2771 Length:2771 Min. :30.92
## Class :character Class :character Class :character 1st Qu.:31.28
## Mode :character Mode :character Mode :character Median :31.60
## Mean :31.62
## 3rd Qu.:31.76
## Max. :33.18
## NA's :2
## longitude date time date_end
## Min. :34.38 Length:2771 Length:2771 Length:2771
## 1st Qu.:34.60 Class :character Class :character Class :character
## Median :34.67 Mode :character Mode :character Mode :character
## Mean :34.75
## 3rd Qu.:34.91
## Max. :35.57
## NA's :2
## time_end activity orientation type
## Length:2771 Length:2771 Length:2771 Length:2771
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## body tail tail_type SciName
## Min. : 27.00 Length:2771 Length:2771 Length:2771
## 1st Qu.: 39.75 Class :character Class :character Class :character
## Median : 51.00 Mode :character Mode :character Mode :character
## Mean :115.11
## 3rd Qu.:152.75
## Max. :450.00
## NA's :2753
## stones_flipped weather temp_shade temp_sun
## Min. : 0.0 Length:2771 Min. :14.00 Min. : 18.40
## 1st Qu.: 70.0 Class :character 1st Qu.:25.20 1st Qu.: 31.00
## Median : 90.0 Mode :character Median :28.80 Median : 39.00
## Mean :101.4 Mean :28.27 Mean : 39.61
## 3rd Qu.:140.0 3rd Qu.:31.40 3rd Qu.: 45.00
## Max. :240.0 Max. :42.50 Max. :511.00
## NA's :2151 NA's :926 NA's :926
## site_description obs_snout_len obs_tail_len obs_regentail_len
## Length:2771 Min. : 28.00 Min. : 5.00 Min. : 0.00
## Class :character 1st Qu.: 41.25 1st Qu.: 30.75 1st Qu.: 0.00
## Mode :character Median : 79.50 Median : 45.00 Median :10.00
## Mean : 173.97 Mean : 85.45 Mean :10.62
## 3rd Qu.: 223.25 3rd Qu.: 68.00 3rd Qu.:19.00
## Max. :1210.00 Max. :590.00 Max. :23.00
## NA's :2731 NA's :2731 NA's :2758
## material obs_notes disturbance sv
## Length:2771 Length:2771 Length:2771 Min. : 19.0
## Class :character Class :character Class :character 1st Qu.: 36.0
## Mode :character Mode :character Mode :character Median : 57.0
## Mean :133.2
## 3rd Qu.:217.0
## Max. :603.0
## NA's :2715
## t regen_t substrate survey_protocol
## Min. : 9.00 Min. : 2.00 Length:2771 Length:2771
## 1st Qu.: 30.00 1st Qu.: 3.00 Class :character Class :character
## Median : 50.00 Median : 13.00 Mode :character Mode :character
## Mean : 54.89 Mean : 25.28
## 3rd Qu.: 70.00 3rd Qu.: 25.75
## Max. :250.00 Max. :125.00
## NA's :2715 NA's :2759
## count_individuals weather_desc wind sex_new
## Min. : 1.000 Length:2771 Length:2771 Length:2771
## 1st Qu.: 1.000 Class :character Class :character Class :character
## Median : 1.000 Mode :character Mode :character Mode :character
## Mean : 2.249
## 3rd Qu.: 2.000
## Max. :50.000
##
## age observation_type Column
## Length:2771 Length:2771 Length:2771
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
# Unit
reptiles[, sort(unique(unit))] # 5 units
## [1] "Coastal Plain Sands"
## [2] "Inland Sands"
## [3] "Loess Covered Areas in the Northern Negev"
## [4] "Mediterranean-Desert Transition Zone"
## [5] "Planted Conifer Forests"
reptiles[is.na(unit), .N] # no missing monitoring units
## [1] 0
# Campaigns
reptiles[, .(year = sort(unique(year))), keyby = .(unit, campaign)] # Loess data includes 2013 - the pilot year with a different protocol, and it should be omitted
## unit campaign year
## 1: Coastal Plain Sands T0 2014
## 2: Coastal Plain Sands T1 2015
## 3: Coastal Plain Sands T2 2017
## 4: Coastal Plain Sands T3 2019
## 5: Coastal Plain Sands T4 2021
## 6: Inland Sands T2 2017
## 7: Inland Sands T3 2019
## 8: Inland Sands T4 2021
## 9: Loess Covered Areas in the Northern Negev T0 2013
## 10: Loess Covered Areas in the Northern Negev T0 2014
## 11: Loess Covered Areas in the Northern Negev T1 2016
## 12: Loess Covered Areas in the Northern Negev T2 2018
## 13: Loess Covered Areas in the Northern Negev T3 2020
## 14: Mediterranean-Desert Transition Zone T0 2014
## 15: Mediterranean-Desert Transition Zone T1 2016
## 16: Mediterranean-Desert Transition Zone T2 2018
## 17: Mediterranean-Desert Transition Zone T3 2020
## 18: Planted Conifer Forests T0 2014
## 19: Planted Conifer Forests T1 2015
## 20: Planted Conifer Forests T2 2017
## 21: Planted Conifer Forests T3 2019
## 22: Planted Conifer Forests T4 2021
## unit campaign year
reptiles <- reptiles[!(year == 2013 & unit %like% 'Loess')]
reptiles[, .(year = sort(unique(year))), keyby = .(unit, campaign)] # problem solved
## unit campaign year
## 1: Coastal Plain Sands T0 2014
## 2: Coastal Plain Sands T1 2015
## 3: Coastal Plain Sands T2 2017
## 4: Coastal Plain Sands T3 2019
## 5: Coastal Plain Sands T4 2021
## 6: Inland Sands T2 2017
## 7: Inland Sands T3 2019
## 8: Inland Sands T4 2021
## 9: Loess Covered Areas in the Northern Negev T0 2014
## 10: Loess Covered Areas in the Northern Negev T1 2016
## 11: Loess Covered Areas in the Northern Negev T2 2018
## 12: Loess Covered Areas in the Northern Negev T3 2020
## 13: Mediterranean-Desert Transition Zone T0 2014
## 14: Mediterranean-Desert Transition Zone T1 2016
## 15: Mediterranean-Desert Transition Zone T2 2018
## 16: Mediterranean-Desert Transition Zone T3 2020
## 17: Planted Conifer Forests T0 2014
## 18: Planted Conifer Forests T1 2015
## 19: Planted Conifer Forests T2 2017
## 20: Planted Conifer Forests T3 2019
## 21: Planted Conifer Forests T4 2021
## unit campaign year
# Sites, plot and coordinates
reptiles[is.na(site)] # no missing sites
## Empty data.table (0 rows and 47 cols): campaign,year,unit,subunit,site,point_name...
reptiles[, sort(unique(site))] # Eshel Nanasi is a typo! Ramat HaShofet capitalization should be consistent
## [1] "Aderet" "Amatzia" "Ashdod" "Ashkelon"
## [5] "Bat Shlomo" "Beer Milka" "Beit Yatir" "Caesarea"
## [9] "Eitanim" "Elyakim" "Eshel Hanasi" "Eshtaol"
## [13] "Givat Yeshayahu" "Givot Bar" "Goral" "Har Amasa"
## [17] "Kabri" "Kerem Maharal" "Lahav" "Lehavim"
## [21] "Manara" "Meron" "Mirsham" "Mishmar Hanegev"
## [25] "Nahal Ashan" "Netiv Haasara" "Ofer" "Park Loess"
## [29] "Ramat Hashofet" "Ramot Naftali" "Sayeret Shaked" "Secher"
## [33] "Shunra East" "Zikim" "Zuriel"
reptiles[is.na(latitude) | is.na(longitude), .N] # 2 records have missing coordinates
## [1] 2
reptiles[point_name %in% reptiles[is.na(latitude) | is.na(longitude), point_name]] # These are the sole two records from these plots and so I cannot fill in the missing coordinates
## campaign year unit subunit site
## 1: T0 2014 Mediterranean-Desert Transition Zone <NA> Lehavim
## 2: T0 2014 Mediterranean-Desert Transition Zone <NA> Lehavim
## point_name settlements agriculture habitat dunes observations_id
## 1: Lehavim Near 1 Near <NA> <NA> <NA>
## 2: Lehavim Near 6 Near <NA> <NA> <NA>
## latitude longitude date time date_end time_end activity
## 1: NA NA 24/04/2014 10:50:00 remains
## 2: NA NA 24/04/2014 11:23:00 feces
## orientation type body tail tail_type SciName stones_flipped
## 1: on ground NA <NA> <NA> Testudo graeca NA
## 2: on rock NA <NA> <NA> Laudakia vulgaris NA
## weather temp_shade temp_sun site_description obs_snout_len obs_tail_len
## 1: <NA> NA NA <NA> NA NA
## 2: <NA> NA NA <NA> NA NA
## obs_regentail_len material obs_notes disturbance sv t regen_t substrate
## 1: NA <NA> <NA> <NA> NA NA NA <NA>
## 2: NA <NA> <NA> <NA> NA NA NA <NA>
## survey_protocol count_individuals weather_desc wind sex_new age
## 1: scan 1 <NA> <NA> <NA> <NA>
## 2: scan 1 <NA> <NA> <NA> <NA>
## observation_type Column
## 1: indirect <NA>
## 2: indirect <NA>
reptiles[, sort(unique(site))] # no apparent repetition in site names
## [1] "Aderet" "Amatzia" "Ashdod" "Ashkelon"
## [5] "Bat Shlomo" "Beer Milka" "Beit Yatir" "Caesarea"
## [9] "Eitanim" "Elyakim" "Eshel Hanasi" "Eshtaol"
## [13] "Givat Yeshayahu" "Givot Bar" "Goral" "Har Amasa"
## [17] "Kabri" "Kerem Maharal" "Lahav" "Lehavim"
## [21] "Manara" "Meron" "Mirsham" "Mishmar Hanegev"
## [25] "Nahal Ashan" "Netiv Haasara" "Ofer" "Park Loess"
## [29] "Ramat Hashofet" "Ramot Naftali" "Sayeret Shaked" "Secher"
## [33] "Shunra East" "Zikim" "Zuriel"
reptiles[is.na(point_name), .N] # 523 missing point names
## [1] 523
missing.plot.names <- reptiles.raw[year != 2013 & is.na(point_name)]
setcolorder(missing.plot.names, c('unit', 'campaign', 'year', 'site', 'habitat', 'dunes', 'agriculture', 'settlements', 'subunit',
'date', 'time', 'latitude', 'longitude', 'SciName', 'count_individuals'))
setorder(missing.plot.names, unit, campaign, site, date, time)
missing.plot.names
## unit campaign year site
## 1: Loess Covered Areas in the Northern Negev T0 2014 Eshel Hanasi
## 2: Loess Covered Areas in the Northern Negev T0 2014 Eshel Hanasi
## 3: Loess Covered Areas in the Northern Negev T0 2014 Eshel Hanasi
## 4: Loess Covered Areas in the Northern Negev T0 2014 Eshel Hanasi
## 5: Loess Covered Areas in the Northern Negev T0 2014 Eshel Hanasi
## ---
## 519: Planted Conifer Forests T1 2015 Zuriel
## 520: Planted Conifer Forests T1 2015 Zuriel
## 521: Planted Conifer Forests T1 2015 Zuriel
## 522: Planted Conifer Forests T1 2015 Zuriel
## 523: Planted Conifer Forests T1 2015 Zuriel
## habitat dunes agriculture settlements subunit date
## 1: bedouin agriculture <NA> <NA> <NA> <NA> 16/06/2014
## 2: bedouin agriculture <NA> <NA> <NA> <NA> 16/06/2014
## 3: bedouin agriculture <NA> <NA> <NA> <NA> 16/06/2014
## 4: bedouin agriculture <NA> <NA> <NA> <NA> 16/06/2014
## 5: bedouin agriculture <NA> <NA> <NA> <NA> 16/06/2014
## ---
## 519: <NA> <NA> <NA> <NA> Galilee 25/11/2015
## 520: <NA> <NA> <NA> <NA> Galilee 25/11/2015
## 521: <NA> <NA> <NA> <NA> Galilee 25/11/2015
## 522: <NA> <NA> <NA> <NA> Galilee 25/11/2015
## 523: <NA> <NA> <NA> <NA> Galilee 25/11/2015
## time latitude longitude SciName count_individuals
## 1: 13:38:00 31.33814 34.71649 Ophisops elegans 1
## 2: 13:41:00 31.33814 34.71649 Ophisops elegans 1
## 3: 13:43:00 31.33814 34.71649 Ophisops elegans 1
## 4: 13:45:00 31.33814 34.71649 Stellagama stellio 1
## 5: 13:47:00 31.33814 34.71649 Ophisops elegans 1
## ---
## 519: 11:41:00 33.01398 35.31735 Ablepharus rueppellii 1
## 520: 11:41:00 33.01398 35.31735 Ablepharus rueppellii 2
## 521: 11:41:00 33.01398 35.31735 Ablepharus rueppellii 1
## 522: 11:41:00 33.01398 35.31735 Phoenicolacerta laevis 1
## 523: 11:41:00 33.01398 35.31735 Phoenicolacerta laevis 1
## point_name observations_id date_end time_end activity orientation
## 1: <NA> moving on
## 2: <NA> moving on
## 3: <NA> shelter under
## 4: <NA> feces between
## 5: <NA> moving between
## ---
## 519: <NA> moving on
## 520: <NA> moving on
## 521: <NA> moving on
## 522: <NA> moving near
## 523: <NA> basking on
## type body tail tail_type stones_flipped weather temp_shade
## 1: dirt road NA <NA> <NA> NA <NA> NA
## 2: rock NA <NA> <NA> NA <NA> NA
## 3: rock NA <NA> <NA> NA <NA> NA
## 4: shrubs NA <NA> <NA> NA <NA> NA
## 5: shrubs NA <NA> <NA> NA <NA> NA
## ---
## 519: leaf litter NA <NA> original NA <NA> NA
## 520: leaf litter NA <NA> <NA> NA <NA> NA
## 521: leaf litter NA <NA> regenerated NA <NA> NA
## 522: shrub NA <NA> regenerated NA <NA> NA
## 523: tree NA <NA> regenerated NA <NA> NA
## temp_sun site_description obs_snout_len obs_tail_len obs_regentail_len
## 1: NA <NA> NA NA NA
## 2: NA <NA> NA NA NA
## 3: NA <NA> NA NA NA
## 4: NA <NA> NA NA NA
## 5: NA <NA> NA NA NA
## ---
## 519: NA <NA> NA NA NA
## 520: NA <NA> NA NA NA
## 521: NA <NA> NA NA NA
## 522: NA <NA> NA NA NA
## 523: NA <NA> NA NA NA
## material obs_notes disturbance sv t regen_t substrate survey_protocol
## 1: <NA> <NA> <NA> NA NA NA <NA> scan
## 2: <NA> <NA> <NA> NA NA NA <NA> scan
## 3: <NA> <NA> <NA> NA NA NA <NA> scan
## 4: <NA> <NA> <NA> NA NA NA <NA> scan
## 5: <NA> <NA> <NA> NA NA NA <NA> scan
## ---
## 519: <NA> <NA> <NA> NA NA NA <NA> scan
## 520: <NA> <NA> <NA> NA NA NA <NA> scan
## 521: <NA> <NA> <NA> NA NA NA <NA> scan
## 522: <NA> <NA> <NA> NA NA NA <NA> scan
## 523: <NA> <NA> <NA> NA NA NA <NA> scan
## weather_desc wind sex_new age observation_type Column
## 1: <NA> <NA> <NA> juvenile direct <NA>
## 2: <NA> <NA> <NA> juvenile direct <NA>
## 3: <NA> <NA> <NA> juvenile direct <NA>
## 4: <NA> <NA> male <NA> indirect <NA>
## 5: <NA> <NA> female <NA> direct <NA>
## ---
## 519: <NA> <NA> <NA> juvenile direct <NA>
## 520: <NA> <NA> <NA> subadult direct <NA>
## 521: <NA> <NA> <NA> adult direct <NA>
## 522: <NA> <NA> <NA> juvenile direct <NA>
## 523: <NA> <NA> <NA> adult direct <NA>
reptiles[is.na(point_name), .N, keyby = .(unit)] # all in Loess, semi desert and planted forests
## unit N
## 1: Loess Covered Areas in the Northern Negev 173
## 2: Mediterranean-Desert Transition Zone 178
## 3: Planted Conifer Forests 172
reptiles[is.na(point_name), .N, keyby = .(unit, year)] # all missing point names are in 2014-2016
## unit year N
## 1: Loess Covered Areas in the Northern Negev 2014 92
## 2: Loess Covered Areas in the Northern Negev 2016 81
## 3: Mediterranean-Desert Transition Zone 2014 85
## 4: Mediterranean-Desert Transition Zone 2016 93
## 5: Planted Conifer Forests 2014 50
## 6: Planted Conifer Forests 2015 122
multi_coords_plots <- reptiles[!is.na(point_name), .(no.of.lats = uniqueN(latitude), no.of.lons = uniqueN(longitude)), keyby = .(site, point_name)][
no.of.lats > 1 | no.of.lons > 1] # 4 point names have more than one set of coordinates
multi_coords_plots
## site point_name no.of.lats no.of.lons
## 1: Beer Milka Beer Milka Near Semi-Shifting 2 2 2
## 2: Beer Milka Beer Milka Near Semi-Shifting 3 2 2
## 3: Nahal Ashan Nahal Ashan KKL Plantings 2 2 2
## 4: Zikim Far semi-shifting 3 2 2
reptiles[point_name %in% multi_coords_plots$point_name & site %in% multi_coords_plots$site,
.(lat = unique(latitude), lon = unique(longitude)), keyby = .(site, point_name)] # difference amounts to the third digit after the decimal point
## site point_name lat lon
## 1: Beer Milka Beer Milka Near Semi-Shifting 2 30.97014 34.37721
## 2: Beer Milka Beer Milka Near Semi-Shifting 2 30.97101 34.37759
## 3: Beer Milka Beer Milka Near Semi-Shifting 3 30.91639 34.43070
## 4: Beer Milka Beer Milka Near Semi-Shifting 3 30.91702 34.43035
## 5: Nahal Ashan Nahal Ashan KKL Plantings 2 31.28265 34.74863
## 6: Nahal Ashan Nahal Ashan KKL Plantings 2 31.28265 34.74862
## 7: Zikim Far semi-shifting 3 31.61583 34.51777
## 8: Zikim Far semi-shifting 3 31.61800 34.51935
reptiles[is.na(point_name), point_name := paste(site, case_when(!is.na(settlements) ~ settlements,
!is.na(agriculture) ~ agriculture,
!is.na(habitat) ~ habitat,
!is.na(dunes) ~ dunes,
.default = ''),
paste(latitude, longitude, sep = '_'), sep = ' ')] # use the original point name, unless it is missing
reptiles[, sort(unique(point_name))] # Hazerim Loess 2 should be Sayeret Shaked Loess 2
## [1] "Aderet 31.67144877_34.9880248"
## [2] "Aderet 31.67145208_34.98801954"
## [3] "Aderet 31.67577723_34.98668826"
## [4] "Aderet 31.67578059_34.98668299"
## [5] "Aderet 31.67867469_34.98154177"
## [6] "Aderet KKL Plantings 3"
## [7] "Aderet KKL Plantings 1"
## [8] "Aderet KKL Plantings 2"
## [9] "Aderet KKL Plantings 3"
## [10] "Amatzia 31.50751869_34.8949584"
## [11] "Amatzia 31.50752022_34.89495214"
## [12] "Amatzia 31.51244719_34.89349107"
## [13] "Amatzia 31.51244878_34.8934848"
## [14] "Amatzia 31.51439867_34.8982574"
## [15] "Amatzia 31.51440028_34.89825118"
## [16] "Amatzia KKL Plantings 1"
## [17] "Amatzia KKL Plantings 2"
## [18] "Amatzia KKL Plantings 3"
## [19] "Ashdod Far Semi-Shifting 1"
## [20] "Ashdod Far Semi-Shifting 2"
## [21] "Ashdod Far Semi-Shifting 3"
## [22] "Ashdod Far Shifting 1"
## [23] "Ashdod Far Shifting 2"
## [24] "Ashdod Far Shifting 3"
## [25] "Ashdod Near Semi-Shifting 1"
## [26] "Ashdod Near Semi-Shifting 2"
## [27] "Ashdod Near Semi-Shifting 3"
## [28] "Ashkelon Far Semi-Shifting 1"
## [29] "Ashkelon Far Semi-Shifting 2"
## [30] "Ashkelon Far Semi-Shifting 3"
## [31] "Ashkelon Far Shifting 1"
## [32] "Ashkelon Far Shifting 2"
## [33] "Ashkelon Far Shifting 3"
## [34] "Ashkelon Near Semi-Shifting 1"
## [35] "Ashkelon Near Semi-Shifting 2"
## [36] "Ashkelon Near Semi-Shifting 3"
## [37] "Bat Shlomo 32.58547442_35.01415585"
## [38] "Bat Shlomo 32.58716874_35.01054242"
## [39] "Bat Shlomo 32.58718195_35.01053736"
## [40] "Bat Shlomo KKL Plantings 1"
## [41] "Bat Shlomo KKL Plantings 2"
## [42] "Bat Shlomo KKL Plantings 3"
## [43] "Beer Milka Far Semi-Shifting 2"
## [44] "Beer Milka Far Semi-Shifting 3"
## [45] "Beer Milka Far Semi-Shifting 4"
## [46] "Beer Milka Far Shifting 1"
## [47] "Beer Milka Far Shifting 2"
## [48] "Beer Milka Far Shifting 3"
## [49] "Beer Milka Far Shifting 3a"
## [50] "Beer Milka Near Semi-Shifting 1"
## [51] "Beer Milka Near Semi-Shifting 2"
## [52] "Beer Milka Near Semi-Shifting 3"
## [53] "Beer Milka Near Shifting 1"
## [54] "Beer Milka Near Shifting 2"
## [55] "Beer Milka Near Shifting 3"
## [56] "Beit Yatir Far 1"
## [57] "Beit Yatir Far 2"
## [58] "Beit Yatir Far 3"
## [59] "Beit Yatir Far 31.35013846_35.11235947"
## [60] "Beit Yatir Far 31.35013862_35.11236337"
## [61] "Beit Yatir Far 31.35114151_35.12245726"
## [62] "Beit Yatir Far 31.35114166_35.12246105"
## [63] "Beit Yatir Far 31.36048202_35.13023961"
## [64] "Beit Yatir Far 31.36048207_35.13024331"
## [65] "Beit Yatir Near 1"
## [66] "Beit Yatir Near 31.35936566_35.11638381"
## [67] "Beit Yatir Near 31.35936572_35.11638766"
## [68] "Beit Yatir Near 31.3616697_35.10994797"
## [69] "Beit Yatir Near 31.36253667_35.11037048"
## [70] "Beit Yatir Near 31.36983661_35.11023647"
## [71] "Beit Yatir Near 31.36983666_35.11023255"
## [72] "Beit Yatir Near 4"
## [73] "Beit Yatir Near 5"
## [74] "Caesarea Far Semi-Shifting 1"
## [75] "Caesarea Far Semi-Shifting 2"
## [76] "Caesarea Far Semi-Shifting 3"
## [77] "Caesarea Far Shifting 1"
## [78] "Caesarea Far Shifting 2"
## [79] "Caesarea Far Shifting 3"
## [80] "Caesarea Near Semi-Shifting 1"
## [81] "Caesarea Near Semi-Shifting 2"
## [82] "Caesarea Near Semi-Shifting 3"
## [83] "Eitanim 31.77492651_35.09886264"
## [84] "Eitanim 31.77814645_35.10938566"
## [85] "Eitanim 31.77909156_35.10359697"
## [86] "Eitanim KKL Plantings 1"
## [87] "Eitanim KKL Plantings 2"
## [88] "Eitanim KKL Plantings 3"
## [89] "Elyakim 32.66370396_35.05617847"
## [90] "Elyakim 32.663718_35.0561739"
## [91] "Elyakim 32.66705144_35.05568733"
## [92] "Elyakim 32.66706551_35.05568276"
## [93] "Elyakim 32.6672786_35.06301256"
## [94] "Elyakim 32.66729268_35.06300807"
## [95] "Elyakim KKL Plantings 1"
## [96] "Elyakim KKL Plantings 2"
## [97] "Elyakim KKL Plantings 3"
## [98] "Eshel Hanasi Bedouin Agriculture 1"
## [99] "Eshel Hanasi bedouin agriculture 31.33814194_34.71648947"
## [100] "Eshel Hanasi bedouin agriculture 31.33814225_34.71649764"
## [101] "Eshel Hanasi bedouin agriculture 31.34189216_34.7090606"
## [102] "Eshel Hanasi bedouin agriculture 31.34189242_34.70906885"
## [103] "Eshel Hanasi bedouin agriculture 31.35262598_34.70604572"
## [104] "Eshtaol 31.78378561_35.02056481"
## [105] "Eshtaol 31.78694021_35.02193935"
## [106] "Eshtaol 31.79075347_35.01995897"
## [107] "Eshtaol KKL Plantings 4"
## [108] "Eshtaol KKL Plantings 1"
## [109] "Eshtaol KKL Plantings 3"
## [110] "Eshtaol KKL Plantings 4"
## [111] "Far semi-shifting 1"
## [112] "Far semi-shifting 2"
## [113] "Far semi-shifting 3"
## [114] "Far shifting 1"
## [115] "Far Shifting 1"
## [116] "Far shifting 2"
## [117] "Far Shifting 2"
## [118] "Far shifting 3"
## [119] "Far Shifting 3"
## [120] "Givat Yeshaayahu KKL Plantings 1"
## [121] "Givat Yeshaayahu KKL Plantings 2"
## [122] "Givat Yeshaayahu KKL Plantings 3"
## [123] "Givat Yeshayahu 31.6654021_34.91739659"
## [124] "Givat Yeshayahu 31.66540534_34.91739057"
## [125] "Givat Yeshayahu 31.66774498_34.92544158"
## [126] "Givat Yeshayahu 31.66774825_34.92543564"
## [127] "Givat Yeshayahu 31.67043992_34.92066036"
## [128] "Givot Bar Bedouin Agriculture 1"
## [129] "Givot Bar Bedouin Agriculture 2"
## [130] "Givot Bar Bedouin Agriculture 3"
## [131] "Givot Bar bedouin agriculture 31.36034694_34.75049867"
## [132] "Givot Bar bedouin agriculture 31.36034701_34.75050648"
## [133] "Givot Bar bedouin agriculture 31.36423692_34.75671353"
## [134] "Givot Bar bedouin agriculture 31.36423695_34.75672127"
## [135] "Givot Bar bedouin agriculture 31.37352214_34.77123341"
## [136] "Givot Bar bedouin agriculture 31.37352221_34.77122583"
## [137] "Goral Bedouin Agriculture 1"
## [138] "Goral Bedouin Agriculture 2"
## [139] "Goral Bedouin Agriculture 3"
## [140] "Goral bedouin agriculture 31.30989169_34.80028378"
## [141] "Har Amasa Far 1"
## [142] "Har Amasa Far 2"
## [143] "Har Amasa Far 31.33245149_35.10733619"
## [144] "Har Amasa Far 31.33245184_35.10734014"
## [145] "Har Amasa Far 31.34690363_35.11116131"
## [146] "Har Amasa Far 31.34690383_35.11116522"
## [147] "Har Amasa Far 31.35044064_35.12192146"
## [148] "Har Amasa Far 31.35044079_35.12192526"
## [149] "Har Amasa Far 5"
## [150] "Har Amasa Near 1"
## [151] "Har Amasa Near 2"
## [152] "Har Amasa Near 3"
## [153] "Har Amasa Near 31.34235562_35.10285599"
## [154] "Har Amasa Near 31.34235586_35.10285999"
## [155] "Har Amasa Near 31.3435548_35.10418644"
## [156] "Har Amasa Near 31.34355503_35.10419043"
## [157] "Har Amasa Near 31.34493183_35.10377892"
## [158] "Har Amasa Near 31.34493205_35.1037829"
## [159] "Hazerim Loess 2"
## [160] "Kabri 33.02024909_35.15766172"
## [161] "Kabri 33.02026699_35.15765825"
## [162] "Kabri 33.02051057_35.16410644"
## [163] "Kabri 33.02052847_35.16410304"
## [164] "Kabri 33.02076963_35.17121742"
## [165] "Kabri 33.02175836_35.17061209"
## [166] "Kabri KKL Plantings 1"
## [167] "Kabri KKL Plantings 2"
## [168] "Kabri KKL Plantings 3"
## [169] "Kerem Maharal 32.61227564_34.96368766"
## [170] "Kerem Maharal 32.61228912_34.96368208"
## [171] "Kerem Maharal 32.61292488_34.96995645"
## [172] "Kerem Maharal 32.61601959_34.96652201"
## [173] "Kerem Maharal KKL Plantings 1"
## [174] "Kerem Maharal KKL Plantings 2"
## [175] "Kerem Maharal KKL Plantings 3"
## [176] "Lahav Far 1"
## [177] "Lahav Far 2"
## [178] "Lahav Far 3"
## [179] "Lahav Far 31.38801477_34.86043462"
## [180] "Lahav Far 31.38801501_34.860428"
## [181] "Lahav Far 31.39560377_34.85919049"
## [182] "Lahav Far 31.39560409_34.85918386"
## [183] "Lahav Far 31.39574464_34.86749377"
## [184] "Lahav Near 1"
## [185] "Lahav Near 3"
## [186] "Lahav Near 31.38063825_34.86322581"
## [187] "Lahav Near 31.38063841_34.86321922"
## [188] "Lahav Near 31.38116538_34.87382529"
## [189] "Lahav Near 31.38116555_34.87381881"
## [190] "Lahav Near 31.3818483_34.86639998"
## [191] "Lahav Near 31.38184847_34.86639343"
## [192] "Lahav Near 4"
## [193] "Lehavim Far 1"
## [194] "Lehavim Far 2"
## [195] "Lehavim Far 31.33419117_34.82849153"
## [196] "Lehavim Far 31.3350892_34.83998961"
## [197] "Lehavim Far 31.33508953_34.83999645"
## [198] "Lehavim Far 31.35798817_34.84029091"
## [199] "Lehavim Far 31.35798826_34.84029775"
## [200] "Lehavim Far 5"
## [201] "Lehavim Near 1"
## [202] "Lehavim Near 11"
## [203] "Lehavim Near 12"
## [204] "Lehavim Near 31.36355103_34.82061174"
## [205] "Lehavim Near 31.3659832_34.82239692"
## [206] "Lehavim Near 31.36815469_34.82320446"
## [207] "Lehavim Near 31.36815471_34.82319744"
## [208] "Lehavim Near 4"
## [209] "Lehavim Near 6"
## [210] "Manara 33.17320998_35.5510869"
## [211] "Manara 33.18276851_35.54829503"
## [212] "Manara 33.18278817_35.54829586"
## [213] "Manara KKL Plantings 1"
## [214] "Manara KKL Plantings 2"
## [215] "Manara KKL Plantings 3"
## [216] "Meron 32.99189342_35.45548018"
## [217] "Meron KKL Plantings 1"
## [218] "Meron KKL Plantings 2"
## [219] "Meron KKL Plantings 3"
## [220] "Mirsham Far 11"
## [221] "Mirsham Far 12"
## [222] "Mirsham Far 2"
## [223] "Mirsham Far 31.45827583_34.9010133"
## [224] "Mirsham Far 31.45827683_34.90100711"
## [225] "Mirsham Far 31.47465474_34.9201405"
## [226] "Mirsham Far 31.5002719_34.92750673"
## [227] "Mirsham Far 31.50077201_34.93925215"
## [228] "Mirsham Far 31.50077347_34.93924637"
## [229] "Mirsham Near 1"
## [230] "Mirsham Near 31.47629966_34.92475669"
## [231] "Mirsham Near 31.47977814_34.92723773"
## [232] "Mirsham Near 31.47977937_34.92723182"
## [233] "Mirsham Near 31.48033918_34.92626641"
## [234] "Mirsham Near 31.48034042_34.92626049"
## [235] "Mirsham Near 81"
## [236] "Mirsham Near 9"
## [237] "Mishmar Hanegev Bedouin Agriculture 1"
## [238] "Mishmar Hanegev Bedouin Agriculture 2"
## [239] "Mishmar Hanegev Bedouin Agriculture 3"
## [240] "Mishmar Hanegev bedouin agriculture 31.35953705_34.74353936"
## [241] "Mishmar Hanegev bedouin agriculture 31.35953712_34.74354725"
## [242] "Mishmar Hanegev bedouin agriculture 31.3696375_34.74637779"
## [243] "Mishmar Hanegev bedouin agriculture 31.36963753_34.74636994"
## [244] "Mishmar Hanegev bedouin agriculture 31.37129171_34.73661073"
## [245] "Mishmar Hanegev bedouin agriculture 31.37129176_34.73660277"
## [246] "Mishmar Hanegev KKL Plantings 1"
## [247] "Mishmar Hanegev KKL Plantings 2"
## [248] "Mishmar Hanegev KKL Plantings 3"
## [249] "Mishmar Hanegev kkl plantings 31.36351136_34.73422216"
## [250] "Mishmar Hanegev kkl plantings 31.36351139_34.73423014"
## [251] "Mishmar Hanegev kkl plantings 31.36493851_34.72983363"
## [252] "Mishmar Hanegev kkl plantings 31.36493852_34.72984166"
## [253] "Mishmar Hanegev kkl plantings 31.36761346_34.73241737"
## [254] "Nahal Ashan KKL Plantings 1"
## [255] "Nahal Ashan KKL Plantings 2"
## [256] "Nahal Ashan KKL Plantings 3"
## [257] "Nahal Ashan kkl plantings 31.28265003_34.74862372"
## [258] "Nahal Ashan kkl plantings 31.28265093_34.74863154"
## [259] "Nahal Ashan kkl plantings 31.28684679_34.74364408"
## [260] "Nahal Ashan kkl plantings 31.28684766_34.74365196"
## [261] "Nahal Ashan kkl plantings 31.29349178_34.74750308"
## [262] "Nahal Ashan kkl plantings 31.29349257_34.74751092"
## [263] "Nahal Ashan Loess 1"
## [264] "Nahal Ashan Loess 2"
## [265] "Nahal Ashan Loess 3"
## [266] "Nahal Ashan loess 31.28245503_34.75764806"
## [267] "Nahal Ashan loess 31.28245593_34.75765578"
## [268] "Nahal Ashan loess 31.29271253_34.76700752"
## [269] "Nahal Ashan loess 31.29271333_34.76701515"
## [270] "Nahal Ashan loess 31.29436508_34.77658303"
## [271] "Nahal Ashan loess 31.29436586_34.77659055"
## [272] "Near semi-shifting 1"
## [273] "Near Semi-shifting 1"
## [274] "Near semi-shifting 2"
## [275] "Near Semi-shifting 2"
## [276] "Near semi-shifting 3"
## [277] "Near Semi-shifting 3"
## [278] "Ofer 32.65474897_34.97793598"
## [279] "Ofer 32.66030673_34.97882779"
## [280] "Ofer 32.66032073_34.97882237"
## [281] "Ofer 32.66114693_34.9686609"
## [282] "Ofer 32.66116094_34.96865537"
## [283] "Ofer KKL Plantings 1"
## [284] "Ofer KKL Plantings 1"
## [285] "Ofer KKL Plantings 2"
## [286] "Ofer KKL Plantings 3"
## [287] "Park Loess Loess 1"
## [288] "Park Loess Loess 2"
## [289] "Park Loess Loess 3"
## [290] "Park Loess loess 31.21706343_34.57620702"
## [291] "Park Loess loess 31.21706506_34.57621669"
## [292] "Park Loess loess 31.22728013_34.60140018"
## [293] "Park Loess loess 31.22728165_34.60140959"
## [294] "Park Loess loess 31.24477105_34.60143498"
## [295] "Park Loess loess 31.24477238_34.60144439"
## [296] "Ramat Hashofet 32.61710013_35.11234171"
## [297] "Ramat Hashofet 32.62225135_35.11265519"
## [298] "Ramat Hashofet 33.0939666_35.5664466"
## [299] "Ramat Hashofet 33.098205_35.564775"
## [300] "Ramat Hashofet KKL Plantings 1"
## [301] "Ramat Hashofet KKL Plantings 2"
## [302] "Ramat Hashofet KKL Plantings 4"
## [303] "Ramat Hashofet KKL Plantings 4a"
## [304] "Ramot Naftali 33.09405282_35.56702946"
## [305] "Ramot Naftali 33.09475371_35.56140929"
## [306] "Ramot Naftali 33.09853595_35.56487564"
## [307] "Ramot Naftali KKL Plantings 1"
## [308] "Ramot Naftali KKL Plantings 2"
## [309] "Ramot Naftali KKL Plantings 3"
## [310] "Sayeret Shaked KKL Plantings 1"
## [311] "Sayeret Shaked KKL Plantings 3"
## [312] "Sayeret Shaked kkl plantings 31.26322827_34.65977867"
## [313] "Sayeret Shaked kkl plantings 31.26959058_34.66913156"
## [314] "Sayeret Shaked kkl plantings 31.27594968_34.66259602"
## [315] "Sayeret Shaked kkl plantings 31.27595066_34.66260477"
## [316] "Sayeret Shaked KKL Plantings 4"
## [317] "Sayeret Shaked Loess 1"
## [318] "Sayeret Shaked Loess 2"
## [319] "Sayeret Shaked loess 31.27294696_34.69498356"
## [320] "Sayeret Shaked loess 31.27294798_34.69499196"
## [321] "Sayeret Shaked loess 31.27486693_34.68890758"
## [322] "Sayeret Shaked loess 31.28294811_34.68076577"
## [323] "Sayeret Shaked loess 31.28294902_34.68077432"
## [324] "Sayeret Shaked Loess 5"
## [325] "Secher Far Semi-Shifting 1"
## [326] "Secher Far Semi-Shifting 3"
## [327] "Secher Far Semi-Shifting 4"
## [328] "Secher Far Shifting 1"
## [329] "Secher Far Shifting 2"
## [330] "Secher Far Shifting 3"
## [331] "Shunra East Far Semi-Shifting 1"
## [332] "Shunra East Far Semi-Shifting 2"
## [333] "Shunra East Far Semi-Shifting 3"
## [334] "Shunra East Far Shifting 1"
## [335] "Shunra East Far Shifting 2"
## [336] "Shunra East Far Shifting 3"
## [337] "Zikim Far Semi-Shifting 1"
## [338] "Zikim Far Semi-Shifting 2"
## [339] "Zikim Far Semi-Shifting 3"
## [340] "Zikim Far Shifting 1"
## [341] "Zikim Far Shifting 2"
## [342] "Zikim Far Shifting 3"
## [343] "Zikim Near Semi-Shifting 1"
## [344] "Zikim Near Semi-Shifting 2"
## [345] "Zikim Near Semi-Shifting 3"
## [346] "Zuriel 33.01091098_35.31488335"
## [347] "Zuriel 33.01092878_35.31488161"
## [348] "Zuriel 33.01398017_35.31735242"
## [349] "Zuriel 33.013998_35.31735071"
## [350] "Zuriel KKL Plantings 1"
## [351] "Zuriel KKL Plantings 2"
## [352] "Zuriel KKL Plantings 3"
reptiles[point_name %like% 'Hazerim', point_name := 'Sayeret Shaked Loess 2']
reptiles[point_name %like% 'Sayeret Shaked Loess 2', point_name := 'Sayeret Shaked Loess 2']
mean.coords <- reptiles[point_name %in% multi_coords_plots$point_name & site %in% multi_coords_plots$site,
.(mean.lat = mean(latitude), mean.lon = mean(longitude)), keyby = .(site, point_name)]
merge(reptiles, mean.coords, by = c('site','point_name'), all.x = T)[!is.na(mean.lat), .(unique(point_name))] # 4 plots have multiple coordinates
## V1
## 1: Beer Milka Near Semi-Shifting 2
## 2: Beer Milka Near Semi-Shifting 3
## 3: Nahal Ashan KKL Plantings 2
## 4: Far semi-shifting 3
reptiles <- merge(reptiles, mean.coords, by = c('site','point_name'), all.x = T) # Add the mean coordinates in cases of multiple coordinates per point name
reptiles[is.na(mean.lat), ':=' (mean.lat = latitude, mean.lon = longitude)] # fill in missing mean coordinates when there is no multiplicity
reptiles[is.na(mean.lat) | is.na(mean.lon)] # same two records with no coordinates
## site point_name campaign year unit
## 1: Lehavim Lehavim Near 1 T0 2014 Mediterranean-Desert Transition Zone
## 2: Lehavim Lehavim Near 6 T0 2014 Mediterranean-Desert Transition Zone
## subunit settlements agriculture habitat dunes observations_id latitude
## 1: <NA> Near <NA> <NA> <NA> NA
## 2: <NA> Near <NA> <NA> <NA> NA
## longitude date time date_end time_end activity orientation type
## 1: NA 24/04/2014 10:50:00 remains on ground
## 2: NA 24/04/2014 11:23:00 feces on rock
## body tail tail_type SciName stones_flipped weather temp_shade
## 1: NA <NA> <NA> Testudo graeca NA <NA> NA
## 2: NA <NA> <NA> Laudakia vulgaris NA <NA> NA
## temp_sun site_description obs_snout_len obs_tail_len obs_regentail_len
## 1: NA <NA> NA NA NA
## 2: NA <NA> NA NA NA
## material obs_notes disturbance sv t regen_t substrate survey_protocol
## 1: <NA> <NA> <NA> NA NA NA <NA> scan
## 2: <NA> <NA> <NA> NA NA NA <NA> scan
## count_individuals weather_desc wind sex_new age observation_type Column
## 1: 1 <NA> <NA> <NA> <NA> indirect <NA>
## 2: 1 <NA> <NA> <NA> <NA> indirect <NA>
## mean.lat mean.lon
## 1: NA NA
## 2: NA NA
reptiles[, conc_lat_lon := paste(mean.lat, mean.lon, sep = '_')] # now we can use mean coordinates to uniquely identify plots
reptiles[, .(no.of.lats = uniqueN(latitude), no.of.lons = uniqueN(longitude)), keyby = point_name][no.of.lats > 1 | no.of.lons > 1] # there are 15 plots with multiple coordinates
## point_name no.of.lats no.of.lons
## 1: Beer Milka Near Semi-Shifting 2 2 2
## 2: Beer Milka Near Semi-Shifting 3 2 2
## 3: Far Shifting 1 3 3
## 4: Far Shifting 2 3 3
## 5: Far Shifting 3 3 3
## 6: Far semi-shifting 1 4 4
## 7: Far semi-shifting 2 4 4
## 8: Far semi-shifting 3 5 5
## 9: Far shifting 1 5 5
## 10: Far shifting 2 5 5
## 11: Far shifting 3 4 4
## 12: Nahal Ashan KKL Plantings 2 2 2
## 13: Near semi-shifting 1 5 5
## 14: Near semi-shifting 2 5 5
## 15: Near semi-shifting 3 5 5
## 16: Sayeret Shaked Loess 2 2 2
multi_coords_plots <- reptiles[, .(no.of.lats = uniqueN(mean.lat), no.of.lons = uniqueN(mean.lon)), keyby = point_name][no.of.lats > 1 | no.of.lons > 1] # 12 plot names with multiple coordinates - all of them do not have a site name!
reptiles[point_name %in% multi_coords_plots$point_name, point_name := paste(site, point_name)]
reptiles[, .(no.of.lats = uniqueN(mean.lat), no.of.lons = uniqueN(mean.lon)), keyby = point_name][no.of.lats > 1 | no.of.lons > 1] # now there are no plot with multiple coordinates
## point_name no.of.lats no.of.lons
## 1: Sayeret Shaked Sayeret Shaked Loess 2 2 2
reptiles[is.na(point_name)] # now there are no missing point names
## Empty data.table (0 rows and 50 cols): site,point_name,campaign,year,unit,subunit...
reptiles[, sort(unique(point_name))] # 380 point names
## [1] "Aderet 31.67144877_34.9880248"
## [2] "Aderet 31.67145208_34.98801954"
## [3] "Aderet 31.67577723_34.98668826"
## [4] "Aderet 31.67578059_34.98668299"
## [5] "Aderet 31.67867469_34.98154177"
## [6] "Aderet KKL Plantings 3"
## [7] "Aderet KKL Plantings 1"
## [8] "Aderet KKL Plantings 2"
## [9] "Aderet KKL Plantings 3"
## [10] "Amatzia 31.50751869_34.8949584"
## [11] "Amatzia 31.50752022_34.89495214"
## [12] "Amatzia 31.51244719_34.89349107"
## [13] "Amatzia 31.51244878_34.8934848"
## [14] "Amatzia 31.51439867_34.8982574"
## [15] "Amatzia 31.51440028_34.89825118"
## [16] "Amatzia KKL Plantings 1"
## [17] "Amatzia KKL Plantings 2"
## [18] "Amatzia KKL Plantings 3"
## [19] "Ashdod Far Semi-Shifting 1"
## [20] "Ashdod Far Semi-Shifting 2"
## [21] "Ashdod Far Semi-Shifting 3"
## [22] "Ashdod Far shifting 1"
## [23] "Ashdod Far Shifting 1"
## [24] "Ashdod Far shifting 2"
## [25] "Ashdod Far Shifting 2"
## [26] "Ashdod Far shifting 3"
## [27] "Ashdod Far Shifting 3"
## [28] "Ashdod Near semi-shifting 1"
## [29] "Ashdod Near Semi-Shifting 1"
## [30] "Ashdod Near semi-shifting 2"
## [31] "Ashdod Near Semi-Shifting 2"
## [32] "Ashdod Near semi-shifting 3"
## [33] "Ashdod Near Semi-Shifting 3"
## [34] "Ashkelon Far semi-shifting 1"
## [35] "Ashkelon Far Semi-Shifting 1"
## [36] "Ashkelon Far semi-shifting 2"
## [37] "Ashkelon Far Semi-Shifting 2"
## [38] "Ashkelon Far semi-shifting 3"
## [39] "Ashkelon Far Semi-Shifting 3"
## [40] "Ashkelon Far shifting 1"
## [41] "Ashkelon Far Shifting 1"
## [42] "Ashkelon Far shifting 2"
## [43] "Ashkelon Far Shifting 2"
## [44] "Ashkelon Far shifting 3"
## [45] "Ashkelon Far Shifting 3"
## [46] "Ashkelon Near semi-shifting 1"
## [47] "Ashkelon Near Semi-Shifting 1"
## [48] "Ashkelon Near semi-shifting 2"
## [49] "Ashkelon Near Semi-Shifting 2"
## [50] "Ashkelon Near semi-shifting 3"
## [51] "Ashkelon Near Semi-Shifting 3"
## [52] "Bat Shlomo 32.58547442_35.01415585"
## [53] "Bat Shlomo 32.58716874_35.01054242"
## [54] "Bat Shlomo 32.58718195_35.01053736"
## [55] "Bat Shlomo KKL Plantings 1"
## [56] "Bat Shlomo KKL Plantings 2"
## [57] "Bat Shlomo KKL Plantings 3"
## [58] "Beer Milka Far Semi-Shifting 2"
## [59] "Beer Milka Far Semi-Shifting 3"
## [60] "Beer Milka Far Semi-Shifting 4"
## [61] "Beer Milka Far Shifting 1"
## [62] "Beer Milka Far Shifting 2"
## [63] "Beer Milka Far Shifting 3"
## [64] "Beer Milka Far Shifting 3a"
## [65] "Beer Milka Near Semi-Shifting 1"
## [66] "Beer Milka Near Semi-Shifting 2"
## [67] "Beer Milka Near Semi-Shifting 3"
## [68] "Beer Milka Near Shifting 1"
## [69] "Beer Milka Near Shifting 2"
## [70] "Beer Milka Near Shifting 3"
## [71] "Beit Yatir Far 1"
## [72] "Beit Yatir Far 2"
## [73] "Beit Yatir Far 3"
## [74] "Beit Yatir Far 31.35013846_35.11235947"
## [75] "Beit Yatir Far 31.35013862_35.11236337"
## [76] "Beit Yatir Far 31.35114151_35.12245726"
## [77] "Beit Yatir Far 31.35114166_35.12246105"
## [78] "Beit Yatir Far 31.36048202_35.13023961"
## [79] "Beit Yatir Far 31.36048207_35.13024331"
## [80] "Beit Yatir Near 1"
## [81] "Beit Yatir Near 31.35936566_35.11638381"
## [82] "Beit Yatir Near 31.35936572_35.11638766"
## [83] "Beit Yatir Near 31.3616697_35.10994797"
## [84] "Beit Yatir Near 31.36253667_35.11037048"
## [85] "Beit Yatir Near 31.36983661_35.11023647"
## [86] "Beit Yatir Near 31.36983666_35.11023255"
## [87] "Beit Yatir Near 4"
## [88] "Beit Yatir Near 5"
## [89] "Caesarea Far semi-shifting 1"
## [90] "Caesarea Far Semi-Shifting 1"
## [91] "Caesarea Far semi-shifting 2"
## [92] "Caesarea Far Semi-Shifting 2"
## [93] "Caesarea Far semi-shifting 3"
## [94] "Caesarea Far Semi-Shifting 3"
## [95] "Caesarea Far shifting 1"
## [96] "Caesarea Far Shifting 1"
## [97] "Caesarea Far shifting 2"
## [98] "Caesarea Far Shifting 2"
## [99] "Caesarea Far shifting 3"
## [100] "Caesarea Far Shifting 3"
## [101] "Caesarea Near semi-shifting 1"
## [102] "Caesarea Near Semi-Shifting 1"
## [103] "Caesarea Near semi-shifting 2"
## [104] "Caesarea Near Semi-Shifting 2"
## [105] "Caesarea Near semi-shifting 3"
## [106] "Caesarea Near Semi-Shifting 3"
## [107] "Eitanim 31.77492651_35.09886264"
## [108] "Eitanim 31.77814645_35.10938566"
## [109] "Eitanim 31.77909156_35.10359697"
## [110] "Eitanim KKL Plantings 1"
## [111] "Eitanim KKL Plantings 2"
## [112] "Eitanim KKL Plantings 3"
## [113] "Elyakim 32.66370396_35.05617847"
## [114] "Elyakim 32.663718_35.0561739"
## [115] "Elyakim 32.66705144_35.05568733"
## [116] "Elyakim 32.66706551_35.05568276"
## [117] "Elyakim 32.6672786_35.06301256"
## [118] "Elyakim 32.66729268_35.06300807"
## [119] "Elyakim KKL Plantings 1"
## [120] "Elyakim KKL Plantings 2"
## [121] "Elyakim KKL Plantings 3"
## [122] "Eshel Hanasi Bedouin Agriculture 1"
## [123] "Eshel Hanasi bedouin agriculture 31.33814194_34.71648947"
## [124] "Eshel Hanasi bedouin agriculture 31.33814225_34.71649764"
## [125] "Eshel Hanasi bedouin agriculture 31.34189216_34.7090606"
## [126] "Eshel Hanasi bedouin agriculture 31.34189242_34.70906885"
## [127] "Eshel Hanasi bedouin agriculture 31.35262598_34.70604572"
## [128] "Eshtaol 31.78378561_35.02056481"
## [129] "Eshtaol 31.78694021_35.02193935"
## [130] "Eshtaol 31.79075347_35.01995897"
## [131] "Eshtaol KKL Plantings 4"
## [132] "Eshtaol KKL Plantings 1"
## [133] "Eshtaol KKL Plantings 3"
## [134] "Eshtaol KKL Plantings 4"
## [135] "Givat Yeshaayahu KKL Plantings 1"
## [136] "Givat Yeshaayahu KKL Plantings 2"
## [137] "Givat Yeshaayahu KKL Plantings 3"
## [138] "Givat Yeshayahu 31.6654021_34.91739659"
## [139] "Givat Yeshayahu 31.66540534_34.91739057"
## [140] "Givat Yeshayahu 31.66774498_34.92544158"
## [141] "Givat Yeshayahu 31.66774825_34.92543564"
## [142] "Givat Yeshayahu 31.67043992_34.92066036"
## [143] "Givot Bar Bedouin Agriculture 1"
## [144] "Givot Bar Bedouin Agriculture 2"
## [145] "Givot Bar Bedouin Agriculture 3"
## [146] "Givot Bar bedouin agriculture 31.36034694_34.75049867"
## [147] "Givot Bar bedouin agriculture 31.36034701_34.75050648"
## [148] "Givot Bar bedouin agriculture 31.36423692_34.75671353"
## [149] "Givot Bar bedouin agriculture 31.36423695_34.75672127"
## [150] "Givot Bar bedouin agriculture 31.37352214_34.77123341"
## [151] "Givot Bar bedouin agriculture 31.37352221_34.77122583"
## [152] "Goral Bedouin Agriculture 1"
## [153] "Goral Bedouin Agriculture 2"
## [154] "Goral Bedouin Agriculture 3"
## [155] "Goral bedouin agriculture 31.30989169_34.80028378"
## [156] "Har Amasa Far 1"
## [157] "Har Amasa Far 2"
## [158] "Har Amasa Far 31.33245149_35.10733619"
## [159] "Har Amasa Far 31.33245184_35.10734014"
## [160] "Har Amasa Far 31.34690363_35.11116131"
## [161] "Har Amasa Far 31.34690383_35.11116522"
## [162] "Har Amasa Far 31.35044064_35.12192146"
## [163] "Har Amasa Far 31.35044079_35.12192526"
## [164] "Har Amasa Far 5"
## [165] "Har Amasa Near 1"
## [166] "Har Amasa Near 2"
## [167] "Har Amasa Near 3"
## [168] "Har Amasa Near 31.34235562_35.10285599"
## [169] "Har Amasa Near 31.34235586_35.10285999"
## [170] "Har Amasa Near 31.3435548_35.10418644"
## [171] "Har Amasa Near 31.34355503_35.10419043"
## [172] "Har Amasa Near 31.34493183_35.10377892"
## [173] "Har Amasa Near 31.34493205_35.1037829"
## [174] "Kabri 33.02024909_35.15766172"
## [175] "Kabri 33.02026699_35.15765825"
## [176] "Kabri 33.02051057_35.16410644"
## [177] "Kabri 33.02052847_35.16410304"
## [178] "Kabri 33.02076963_35.17121742"
## [179] "Kabri 33.02175836_35.17061209"
## [180] "Kabri KKL Plantings 1"
## [181] "Kabri KKL Plantings 2"
## [182] "Kabri KKL Plantings 3"
## [183] "Kerem Maharal 32.61227564_34.96368766"
## [184] "Kerem Maharal 32.61228912_34.96368208"
## [185] "Kerem Maharal 32.61292488_34.96995645"
## [186] "Kerem Maharal 32.61601959_34.96652201"
## [187] "Kerem Maharal KKL Plantings 1"
## [188] "Kerem Maharal KKL Plantings 2"
## [189] "Kerem Maharal KKL Plantings 3"
## [190] "Lahav Far 1"
## [191] "Lahav Far 2"
## [192] "Lahav Far 3"
## [193] "Lahav Far 31.38801477_34.86043462"
## [194] "Lahav Far 31.38801501_34.860428"
## [195] "Lahav Far 31.39560377_34.85919049"
## [196] "Lahav Far 31.39560409_34.85918386"
## [197] "Lahav Far 31.39574464_34.86749377"
## [198] "Lahav Near 1"
## [199] "Lahav Near 3"
## [200] "Lahav Near 31.38063825_34.86322581"
## [201] "Lahav Near 31.38063841_34.86321922"
## [202] "Lahav Near 31.38116538_34.87382529"
## [203] "Lahav Near 31.38116555_34.87381881"
## [204] "Lahav Near 31.3818483_34.86639998"
## [205] "Lahav Near 31.38184847_34.86639343"
## [206] "Lahav Near 4"
## [207] "Lehavim Far 1"
## [208] "Lehavim Far 2"
## [209] "Lehavim Far 31.33419117_34.82849153"
## [210] "Lehavim Far 31.3350892_34.83998961"
## [211] "Lehavim Far 31.33508953_34.83999645"
## [212] "Lehavim Far 31.35798817_34.84029091"
## [213] "Lehavim Far 31.35798826_34.84029775"
## [214] "Lehavim Far 5"
## [215] "Lehavim Near 1"
## [216] "Lehavim Near 11"
## [217] "Lehavim Near 12"
## [218] "Lehavim Near 31.36355103_34.82061174"
## [219] "Lehavim Near 31.3659832_34.82239692"
## [220] "Lehavim Near 31.36815469_34.82320446"
## [221] "Lehavim Near 31.36815471_34.82319744"
## [222] "Lehavim Near 4"
## [223] "Lehavim Near 6"
## [224] "Manara 33.17320998_35.5510869"
## [225] "Manara 33.18276851_35.54829503"
## [226] "Manara 33.18278817_35.54829586"
## [227] "Manara KKL Plantings 1"
## [228] "Manara KKL Plantings 2"
## [229] "Manara KKL Plantings 3"
## [230] "Meron 32.99189342_35.45548018"
## [231] "Meron KKL Plantings 1"
## [232] "Meron KKL Plantings 2"
## [233] "Meron KKL Plantings 3"
## [234] "Mirsham Far 11"
## [235] "Mirsham Far 12"
## [236] "Mirsham Far 2"
## [237] "Mirsham Far 31.45827583_34.9010133"
## [238] "Mirsham Far 31.45827683_34.90100711"
## [239] "Mirsham Far 31.47465474_34.9201405"
## [240] "Mirsham Far 31.5002719_34.92750673"
## [241] "Mirsham Far 31.50077201_34.93925215"
## [242] "Mirsham Far 31.50077347_34.93924637"
## [243] "Mirsham Near 1"
## [244] "Mirsham Near 31.47629966_34.92475669"
## [245] "Mirsham Near 31.47977814_34.92723773"
## [246] "Mirsham Near 31.47977937_34.92723182"
## [247] "Mirsham Near 31.48033918_34.92626641"
## [248] "Mirsham Near 31.48034042_34.92626049"
## [249] "Mirsham Near 81"
## [250] "Mirsham Near 9"
## [251] "Mishmar Hanegev Bedouin Agriculture 1"
## [252] "Mishmar Hanegev Bedouin Agriculture 2"
## [253] "Mishmar Hanegev Bedouin Agriculture 3"
## [254] "Mishmar Hanegev bedouin agriculture 31.35953705_34.74353936"
## [255] "Mishmar Hanegev bedouin agriculture 31.35953712_34.74354725"
## [256] "Mishmar Hanegev bedouin agriculture 31.3696375_34.74637779"
## [257] "Mishmar Hanegev bedouin agriculture 31.36963753_34.74636994"
## [258] "Mishmar Hanegev bedouin agriculture 31.37129171_34.73661073"
## [259] "Mishmar Hanegev bedouin agriculture 31.37129176_34.73660277"
## [260] "Mishmar Hanegev KKL Plantings 1"
## [261] "Mishmar Hanegev KKL Plantings 2"
## [262] "Mishmar Hanegev KKL Plantings 3"
## [263] "Mishmar Hanegev kkl plantings 31.36351136_34.73422216"
## [264] "Mishmar Hanegev kkl plantings 31.36351139_34.73423014"
## [265] "Mishmar Hanegev kkl plantings 31.36493851_34.72983363"
## [266] "Mishmar Hanegev kkl plantings 31.36493852_34.72984166"
## [267] "Mishmar Hanegev kkl plantings 31.36761346_34.73241737"
## [268] "Nahal Ashan KKL Plantings 1"
## [269] "Nahal Ashan KKL Plantings 2"
## [270] "Nahal Ashan KKL Plantings 3"
## [271] "Nahal Ashan kkl plantings 31.28265003_34.74862372"
## [272] "Nahal Ashan kkl plantings 31.28265093_34.74863154"
## [273] "Nahal Ashan kkl plantings 31.28684679_34.74364408"
## [274] "Nahal Ashan kkl plantings 31.28684766_34.74365196"
## [275] "Nahal Ashan kkl plantings 31.29349178_34.74750308"
## [276] "Nahal Ashan kkl plantings 31.29349257_34.74751092"
## [277] "Nahal Ashan Loess 1"
## [278] "Nahal Ashan Loess 2"
## [279] "Nahal Ashan Loess 3"
## [280] "Nahal Ashan loess 31.28245503_34.75764806"
## [281] "Nahal Ashan loess 31.28245593_34.75765578"
## [282] "Nahal Ashan loess 31.29271253_34.76700752"
## [283] "Nahal Ashan loess 31.29271333_34.76701515"
## [284] "Nahal Ashan loess 31.29436508_34.77658303"
## [285] "Nahal Ashan loess 31.29436586_34.77659055"
## [286] "Near Semi-shifting 1"
## [287] "Near Semi-shifting 2"
## [288] "Near Semi-shifting 3"
## [289] "Netiv Haasara Far semi-shifting 1"
## [290] "Netiv Haasara Far semi-shifting 2"
## [291] "Netiv Haasara Far semi-shifting 3"
## [292] "Netiv Haasara Far shifting 1"
## [293] "Netiv Haasara Far shifting 2"
## [294] "Netiv Haasara Far shifting 3"
## [295] "Netiv Haasara Near semi-shifting 1"
## [296] "Netiv Haasara Near semi-shifting 2"
## [297] "Netiv Haasara Near semi-shifting 3"
## [298] "Ofer 32.65474897_34.97793598"
## [299] "Ofer 32.66030673_34.97882779"
## [300] "Ofer 32.66032073_34.97882237"
## [301] "Ofer 32.66114693_34.9686609"
## [302] "Ofer 32.66116094_34.96865537"
## [303] "Ofer KKL Plantings 1"
## [304] "Ofer KKL Plantings 1"
## [305] "Ofer KKL Plantings 2"
## [306] "Ofer KKL Plantings 3"
## [307] "Park Loess Loess 1"
## [308] "Park Loess Loess 2"
## [309] "Park Loess Loess 3"
## [310] "Park Loess loess 31.21706343_34.57620702"
## [311] "Park Loess loess 31.21706506_34.57621669"
## [312] "Park Loess loess 31.22728013_34.60140018"
## [313] "Park Loess loess 31.22728165_34.60140959"
## [314] "Park Loess loess 31.24477105_34.60143498"
## [315] "Park Loess loess 31.24477238_34.60144439"
## [316] "Ramat Hashofet 32.61710013_35.11234171"
## [317] "Ramat Hashofet 32.62225135_35.11265519"
## [318] "Ramat Hashofet 33.0939666_35.5664466"
## [319] "Ramat Hashofet 33.098205_35.564775"
## [320] "Ramat Hashofet KKL Plantings 1"
## [321] "Ramat Hashofet KKL Plantings 2"
## [322] "Ramat Hashofet KKL Plantings 4"
## [323] "Ramat Hashofet KKL Plantings 4a"
## [324] "Ramot Naftali 33.09405282_35.56702946"
## [325] "Ramot Naftali 33.09475371_35.56140929"
## [326] "Ramot Naftali 33.09853595_35.56487564"
## [327] "Ramot Naftali KKL Plantings 1"
## [328] "Ramot Naftali KKL Plantings 2"
## [329] "Ramot Naftali KKL Plantings 3"
## [330] "Sayeret Shaked KKL Plantings 1"
## [331] "Sayeret Shaked KKL Plantings 3"
## [332] "Sayeret Shaked kkl plantings 31.26322827_34.65977867"
## [333] "Sayeret Shaked kkl plantings 31.26959058_34.66913156"
## [334] "Sayeret Shaked kkl plantings 31.27594968_34.66259602"
## [335] "Sayeret Shaked kkl plantings 31.27595066_34.66260477"
## [336] "Sayeret Shaked KKL Plantings 4"
## [337] "Sayeret Shaked Loess 1"
## [338] "Sayeret Shaked loess 31.27294696_34.69498356"
## [339] "Sayeret Shaked loess 31.27294798_34.69499196"
## [340] "Sayeret Shaked loess 31.27486693_34.68890758"
## [341] "Sayeret Shaked loess 31.28294811_34.68076577"
## [342] "Sayeret Shaked loess 31.28294902_34.68077432"
## [343] "Sayeret Shaked Loess 5"
## [344] "Sayeret Shaked Sayeret Shaked Loess 2"
## [345] "Secher Far Semi-Shifting 1"
## [346] "Secher Far Semi-Shifting 3"
## [347] "Secher Far Semi-Shifting 4"
## [348] "Secher Far Shifting 1"
## [349] "Secher Far Shifting 2"
## [350] "Secher Far Shifting 3"
## [351] "Shunra East Far Semi-Shifting 1"
## [352] "Shunra East Far Semi-Shifting 2"
## [353] "Shunra East Far Semi-Shifting 3"
## [354] "Shunra East Far Shifting 1"
## [355] "Shunra East Far Shifting 2"
## [356] "Shunra East Far Shifting 3"
## [357] "Zikim Far semi-shifting 1"
## [358] "Zikim Far Semi-Shifting 1"
## [359] "Zikim Far semi-shifting 2"
## [360] "Zikim Far Semi-Shifting 2"
## [361] "Zikim Far semi-shifting 3"
## [362] "Zikim Far Semi-Shifting 3"
## [363] "Zikim Far shifting 1"
## [364] "Zikim Far Shifting 1"
## [365] "Zikim Far shifting 2"
## [366] "Zikim Far Shifting 2"
## [367] "Zikim Far Shifting 3"
## [368] "Zikim Near semi-shifting 1"
## [369] "Zikim Near Semi-Shifting 1"
## [370] "Zikim Near semi-shifting 2"
## [371] "Zikim Near Semi-Shifting 2"
## [372] "Zikim Near semi-shifting 3"
## [373] "Zikim Near Semi-Shifting 3"
## [374] "Zuriel 33.01091098_35.31488335"
## [375] "Zuriel 33.01092878_35.31488161"
## [376] "Zuriel 33.01398017_35.31735242"
## [377] "Zuriel 33.013998_35.31735071"
## [378] "Zuriel KKL Plantings 1"
## [379] "Zuriel KKL Plantings 2"
## [380] "Zuriel KKL Plantings 3"
no.of.plots <- reptiles[, .(no.of.plots = uniqueN(point_name)), keyby = .(unit, year, site)]
no.of.plots
## unit year site no.of.plots
## 1: Coastal Plain Sands 2014 Ashdod 9
## 2: Coastal Plain Sands 2014 Ashkelon 9
## 3: Coastal Plain Sands 2014 Netiv Haasara 9
## 4: Coastal Plain Sands 2015 Ashdod 12
## 5: Coastal Plain Sands 2015 Ashkelon 9
## ---
## 142: Planted Conifer Forests 2021 Meron 3
## 143: Planted Conifer Forests 2021 Ofer 3
## 144: Planted Conifer Forests 2021 Ramat Hashofet 3
## 145: Planted Conifer Forests 2021 Ramot Naftali 3
## 146: Planted Conifer Forests 2021 Zuriel 1
reptiles[, .(no.of.plots = uniqueN(point_name))] # 380 plots overall
## no.of.plots
## 1: 380
reptiles[, .(no.of.plots = uniqueN(point_name)), keyby = .(unit, subunit, year)] # sampling effort vary considerably per campaign in some units
## unit subunit year no.of.plots
## 1: Coastal Plain Sands <NA> 2014 27
## 2: Coastal Plain Sands <NA> 2015 41
## 3: Coastal Plain Sands <NA> 2017 36
## 4: Coastal Plain Sands <NA> 2019 35
## 5: Coastal Plain Sands <NA> 2021 36
## 6: Inland Sands <NA> 2017 24
## 7: Inland Sands <NA> 2019 24
## 8: Inland Sands <NA> 2021 24
## 9: Loess Covered Areas in the Northern Negev <NA> 2014 24
## 10: Loess Covered Areas in the Northern Negev <NA> 2016 28
## 11: Loess Covered Areas in the Northern Negev <NA> 2018 25
## 12: Loess Covered Areas in the Northern Negev <NA> 2020 22
## 13: Mediterranean-Desert Transition Zone <NA> 2014 29
## 14: Mediterranean-Desert Transition Zone <NA> 2016 28
## 15: Mediterranean-Desert Transition Zone <NA> 2018 30
## 16: Mediterranean-Desert Transition Zone <NA> 2020 30
## 17: Planted Conifer Forests Carmel 2014 8
## 18: Planted Conifer Forests Carmel 2015 15
## 19: Planted Conifer Forests Carmel 2017 13
## 20: Planted Conifer Forests Carmel 2019 14
## 21: Planted Conifer Forests Carmel 2021 15
## 22: Planted Conifer Forests Galilee 2014 10
## 23: Planted Conifer Forests Galilee 2015 7
## 24: Planted Conifer Forests Galilee 2017 12
## 25: Planted Conifer Forests Galilee 2019 11
## 26: Planted Conifer Forests Galilee 2021 9
## 27: Planted Conifer Forests Judean Highlands 2014 10
## 28: Planted Conifer Forests Judean Highlands 2015 12
## 29: Planted Conifer Forests Judean Highlands 2017 13
## 30: Planted Conifer Forests Judean Highlands 2019 14
## 31: Planted Conifer Forests Judean Highlands 2021 13
## unit subunit year no.of.plots
# Dates
reptiles[, sort(unique(date))] # the format is day/month/year
## [1] "01/05/2019" "01/06/2020" "01/06/2021" "01/07/2014" "01/07/2017"
## [6] "01/08/2017" "01/09/2014" "01/10/2014" "02/05/2016" "02/06/2021"
## [11] "02/10/2014" "03/08/2017" "03/11/2015" "04/04/2018" "04/06/2021"
## [16] "04/08/2014" "04/11/2015" "05/05/2014" "05/05/2016" "05/05/2021"
## [21] "05/07/2016" "05/07/2021" "05/08/2014" "05/08/2019" "05/10/2014"
## [26] "05/10/2015" "06/04/2020" "06/08/2017" "06/09/2015" "06/10/2014"
## [31] "06/10/2015" "07/04/2016" "07/06/2016" "07/07/2015" "07/07/2021"
## [36] "08/04/2021" "08/05/2017" "08/05/2018" "09/09/2019" "10/04/2018"
## [41] "10/05/2016" "10/05/2017" "10/06/2014" "10/06/2019" "10/06/2020"
## [46] "10/07/2017" "10/08/2014" "10/09/2021" "11/07/2016" "11/08/2014"
## [51] "12/06/2019" "13/08/2017" "13/10/2014" "14/04/2016" "14/04/2020"
## [56] "14/05/2018" "14/06/2017" "14/10/2014" "15/05/2019" "15/06/2021"
## [61] "15/07/2019" "15/08/2021" "15/10/2021" "15/11/2015" "16/04/2014"
## [66] "16/06/2014" "16/07/2017" "16/09/2015" "17/04/2018" "17/05/2017"
## [71] "17/05/2019" "17/06/2015" "18/06/2015" "19/05/2016" "19/06/2017"
## [76] "19/06/2019" "19/08/2019" "20/05/2015" "20/05/2018" "20/05/2019"
## [81] "21/04/2016" "21/04/2020" "21/06/2017" "21/07/2019" "21/10/2015"
## [86] "22/05/2017" "22/05/2018" "22/05/2019" "22/06/2020" "22/07/2014"
## [91] "22/09/2015" "22/09/2021" "23/06/2014" "23/06/2021" "23/10/2015"
## [96] "24/03/2020" "24/04/2014" "24/05/2016" "24/05/2017" "24/07/2017"
## [101] "24/09/2014" "25/04/2019" "25/07/2021" "25/08/2019" "25/11/2015"
## [106] "26/04/2017" "26/05/2021" "26/06/2014" "26/06/2017" "26/09/2021"
## [111] "27/05/2014" "28/09/2015" "29/04/2017" "29/04/2019" "29/05/2019"
## [116] "29/06/2016" "29/06/2019" "29/08/2019" "30/04/2018" "30/07/2014"
## [121] "30/09/2014" "31/03/2020" "31/08/2014"
reptiles[, Date := as.Date(date, format = '%d/%m/%Y')]
reptiles[, sort(unique(Date))] # now this makes sense!
## [1] "2014-04-16" "2014-04-24" "2014-05-05" "2014-05-27" "2014-06-10"
## [6] "2014-06-16" "2014-06-23" "2014-06-26" "2014-07-01" "2014-07-22"
## [11] "2014-07-30" "2014-08-04" "2014-08-05" "2014-08-10" "2014-08-11"
## [16] "2014-08-31" "2014-09-01" "2014-09-24" "2014-09-30" "2014-10-01"
## [21] "2014-10-02" "2014-10-05" "2014-10-06" "2014-10-13" "2014-10-14"
## [26] "2015-05-20" "2015-06-17" "2015-06-18" "2015-07-07" "2015-09-06"
## [31] "2015-09-16" "2015-09-22" "2015-09-28" "2015-10-05" "2015-10-06"
## [36] "2015-10-21" "2015-10-23" "2015-11-03" "2015-11-04" "2015-11-15"
## [41] "2015-11-25" "2016-04-07" "2016-04-14" "2016-04-21" "2016-05-02"
## [46] "2016-05-05" "2016-05-10" "2016-05-19" "2016-05-24" "2016-06-07"
## [51] "2016-06-29" "2016-07-05" "2016-07-11" "2017-04-26" "2017-04-29"
## [56] "2017-05-08" "2017-05-10" "2017-05-17" "2017-05-22" "2017-05-24"
## [61] "2017-06-14" "2017-06-19" "2017-06-21" "2017-06-26" "2017-07-01"
## [66] "2017-07-10" "2017-07-16" "2017-07-24" "2017-08-01" "2017-08-03"
## [71] "2017-08-06" "2017-08-13" "2018-04-04" "2018-04-10" "2018-04-17"
## [76] "2018-04-30" "2018-05-08" "2018-05-14" "2018-05-20" "2018-05-22"
## [81] "2019-04-25" "2019-04-29" "2019-05-01" "2019-05-15" "2019-05-17"
## [86] "2019-05-20" "2019-05-22" "2019-05-29" "2019-06-10" "2019-06-12"
## [91] "2019-06-19" "2019-06-29" "2019-07-15" "2019-07-21" "2019-08-05"
## [96] "2019-08-19" "2019-08-25" "2019-08-29" "2019-09-09" "2020-03-24"
## [101] "2020-03-31" "2020-04-06" "2020-04-14" "2020-04-21" "2020-06-01"
## [106] "2020-06-10" "2020-06-22" "2021-04-08" "2021-05-05" "2021-05-26"
## [111] "2021-06-01" "2021-06-02" "2021-06-04" "2021-06-15" "2021-06-23"
## [116] "2021-07-05" "2021-07-07" "2021-07-25" "2021-08-15" "2021-09-10"
## [121] "2021-09-22" "2021-09-26" "2021-10-15"
reptiles[, .(no.of.dates = uniqueN(Date)), keyby = .(unit, campaign, year, site, point_name)][no.of.dates > 1] # T0 coastal plain dunes have two dates
## unit campaign year site
## 1: Coastal Plain Sands T0 2014 Ashdod
## 2: Coastal Plain Sands T0 2014 Ashdod
## 3: Coastal Plain Sands T0 2014 Ashdod
## 4: Coastal Plain Sands T0 2014 Ashdod
## 5: Coastal Plain Sands T0 2014 Ashdod
## 6: Coastal Plain Sands T0 2014 Ashdod
## 7: Coastal Plain Sands T0 2014 Ashdod
## 8: Coastal Plain Sands T0 2014 Ashdod
## 9: Coastal Plain Sands T0 2014 Ashdod
## 10: Coastal Plain Sands T0 2014 Ashkelon
## 11: Coastal Plain Sands T0 2014 Ashkelon
## 12: Coastal Plain Sands T0 2014 Ashkelon
## 13: Coastal Plain Sands T0 2014 Ashkelon
## 14: Coastal Plain Sands T0 2014 Ashkelon
## 15: Coastal Plain Sands T0 2014 Netiv Haasara
## 16: Coastal Plain Sands T0 2014 Netiv Haasara
## 17: Coastal Plain Sands T0 2014 Netiv Haasara
## 18: Coastal Plain Sands T0 2014 Netiv Haasara
## 19: Coastal Plain Sands T0 2014 Netiv Haasara
## 20: Coastal Plain Sands T0 2014 Netiv Haasara
## point_name no.of.dates
## 1: Ashdod Far Semi-Shifting 1 2
## 2: Ashdod Far Semi-Shifting 2 2
## 3: Ashdod Far Semi-Shifting 3 2
## 4: Ashdod Far shifting 1 2
## 5: Ashdod Far shifting 2 2
## 6: Ashdod Far shifting 3 2
## 7: Ashdod Near semi-shifting 1 2
## 8: Ashdod Near semi-shifting 2 2
## 9: Ashdod Near semi-shifting 3 2
## 10: Ashkelon Far semi-shifting 1 2
## 11: Ashkelon Far semi-shifting 3 2
## 12: Ashkelon Far shifting 1 2
## 13: Ashkelon Far shifting 3 2
## 14: Ashkelon Near semi-shifting 2 2
## 15: Netiv Haasara Far semi-shifting 1 2
## 16: Netiv Haasara Far semi-shifting 2 2
## 17: Netiv Haasara Far shifting 1 2
## 18: Netiv Haasara Far shifting 2 2
## 19: Netiv Haasara Far shifting 3 2
## 20: Netiv Haasara Near semi-shifting 1 2
reptiles[unit %like% 'Coast' & campaign == 'T0', .(Date = unique(Date)), keyby = .(site, point_name)] # These dates are consecutive
## site point_name Date
## 1: Ashdod Ashdod Far Semi-Shifting 1 2014-09-30
## 2: Ashdod Ashdod Far Semi-Shifting 1 2014-10-01
## 3: Ashdod Ashdod Far Semi-Shifting 2 2014-09-30
## 4: Ashdod Ashdod Far Semi-Shifting 2 2014-10-01
## 5: Ashdod Ashdod Far Semi-Shifting 3 2014-09-30
## 6: Ashdod Ashdod Far Semi-Shifting 3 2014-10-01
## 7: Ashdod Ashdod Far shifting 1 2014-09-30
## 8: Ashdod Ashdod Far shifting 1 2014-10-01
## 9: Ashdod Ashdod Far shifting 2 2014-09-30
## 10: Ashdod Ashdod Far shifting 2 2014-10-01
## 11: Ashdod Ashdod Far shifting 3 2014-09-30
## 12: Ashdod Ashdod Far shifting 3 2014-10-01
## 13: Ashdod Ashdod Near semi-shifting 1 2014-10-01
## 14: Ashdod Ashdod Near semi-shifting 1 2014-10-02
## 15: Ashdod Ashdod Near semi-shifting 2 2014-10-01
## 16: Ashdod Ashdod Near semi-shifting 2 2014-10-02
## 17: Ashdod Ashdod Near semi-shifting 3 2014-10-01
## 18: Ashdod Ashdod Near semi-shifting 3 2014-10-02
## 19: Ashkelon Ashkelon Far semi-shifting 1 2014-10-05
## 20: Ashkelon Ashkelon Far semi-shifting 1 2014-10-06
## 21: Ashkelon Ashkelon Far semi-shifting 2 2014-10-06
## 22: Ashkelon Ashkelon Far semi-shifting 3 2014-10-05
## 23: Ashkelon Ashkelon Far semi-shifting 3 2014-10-06
## 24: Ashkelon Ashkelon Far shifting 1 2014-10-05
## 25: Ashkelon Ashkelon Far shifting 1 2014-10-06
## 26: Ashkelon Ashkelon Far shifting 2 2014-10-02
## 27: Ashkelon Ashkelon Far shifting 3 2014-10-05
## 28: Ashkelon Ashkelon Far shifting 3 2014-10-06
## 29: Ashkelon Ashkelon Near semi-shifting 1 2014-10-06
## 30: Ashkelon Ashkelon Near semi-shifting 2 2014-10-01
## 31: Ashkelon Ashkelon Near semi-shifting 2 2014-10-02
## 32: Ashkelon Ashkelon Near semi-shifting 3 2014-10-02
## 33: Netiv Haasara Netiv Haasara Far semi-shifting 1 2014-10-13
## 34: Netiv Haasara Netiv Haasara Far semi-shifting 1 2014-10-14
## 35: Netiv Haasara Netiv Haasara Far semi-shifting 2 2014-10-13
## 36: Netiv Haasara Netiv Haasara Far semi-shifting 2 2014-10-14
## 37: Netiv Haasara Netiv Haasara Far semi-shifting 3 2014-10-14
## 38: Netiv Haasara Netiv Haasara Far shifting 1 2014-10-13
## 39: Netiv Haasara Netiv Haasara Far shifting 1 2014-10-14
## 40: Netiv Haasara Netiv Haasara Far shifting 2 2014-10-13
## 41: Netiv Haasara Netiv Haasara Far shifting 2 2014-10-14
## 42: Netiv Haasara Netiv Haasara Far shifting 3 2014-10-13
## 43: Netiv Haasara Netiv Haasara Far shifting 3 2014-10-14
## 44: Netiv Haasara Netiv Haasara Near semi-shifting 1 2014-10-13
## 45: Netiv Haasara Netiv Haasara Near semi-shifting 1 2014-10-14
## 46: Netiv Haasara Netiv Haasara Near semi-shifting 2 2014-10-14
## 47: Netiv Haasara Netiv Haasara Near semi-shifting 3 2014-10-14
## site point_name Date
reptiles[, Date := min(Date), keyby = .(unit, campaign, point_name)] #
bla <- copy(reptiles) # Back up before changing dates
bla[, Date := min(Date), keyby = .(unit, campaign, point_name)] # each survey's date will arbitrary gain its earliest date
bla[, sort(unique(Date))] # make sure the dates make sense
## [1] "2014-04-16" "2014-04-24" "2014-05-05" "2014-05-27" "2014-06-10"
## [6] "2014-06-16" "2014-06-23" "2014-06-26" "2014-07-01" "2014-07-22"
## [11] "2014-07-30" "2014-08-04" "2014-08-05" "2014-08-10" "2014-08-11"
## [16] "2014-08-31" "2014-09-01" "2014-09-24" "2014-09-30" "2014-10-01"
## [21] "2014-10-02" "2014-10-05" "2014-10-06" "2014-10-13" "2014-10-14"
## [26] "2015-05-20" "2015-06-17" "2015-06-18" "2015-07-07" "2015-09-06"
## [31] "2015-09-16" "2015-09-22" "2015-09-28" "2015-10-05" "2015-10-06"
## [36] "2015-10-21" "2015-10-23" "2015-11-03" "2015-11-04" "2015-11-15"
## [41] "2015-11-25" "2016-04-07" "2016-04-14" "2016-04-21" "2016-05-02"
## [46] "2016-05-05" "2016-05-10" "2016-05-19" "2016-05-24" "2016-06-07"
## [51] "2016-06-29" "2016-07-05" "2016-07-11" "2017-04-26" "2017-04-29"
## [56] "2017-05-08" "2017-05-10" "2017-05-17" "2017-05-22" "2017-05-24"
## [61] "2017-06-14" "2017-06-19" "2017-06-21" "2017-06-26" "2017-07-01"
## [66] "2017-07-10" "2017-07-16" "2017-07-24" "2017-08-01" "2017-08-03"
## [71] "2017-08-06" "2017-08-13" "2018-04-04" "2018-04-10" "2018-04-17"
## [76] "2018-04-30" "2018-05-08" "2018-05-14" "2018-05-20" "2018-05-22"
## [81] "2019-04-25" "2019-04-29" "2019-05-01" "2019-05-15" "2019-05-17"
## [86] "2019-05-20" "2019-05-22" "2019-05-29" "2019-06-10" "2019-06-12"
## [91] "2019-06-19" "2019-06-29" "2019-07-15" "2019-07-21" "2019-08-05"
## [96] "2019-08-19" "2019-08-25" "2019-08-29" "2019-09-09" "2020-03-24"
## [101] "2020-03-31" "2020-04-06" "2020-04-14" "2020-04-21" "2020-06-01"
## [106] "2020-06-10" "2020-06-22" "2021-04-08" "2021-05-05" "2021-05-26"
## [111] "2021-06-01" "2021-06-02" "2021-06-04" "2021-06-15" "2021-06-23"
## [116] "2021-07-05" "2021-07-07" "2021-07-25" "2021-08-15" "2021-09-10"
## [121] "2021-09-22" "2021-09-26" "2021-10-15"
bla[, .(no.of.dates = uniqueN(Date)), keyby = .(unit, campaign, year, site, point_name, point_name)][no.of.dates > 1] # now there is only one date per survey
## Empty data.table (0 rows and 7 cols): unit,campaign,year,site,point_name,point_name.1...
reptiles <- copy(bla) # return to the original data name
rm(bla) # clean up
# time
setorder(reptiles, unit, campaign, site, point_name, time)
reptiles[, sort(unique(time))]
## [1] "10:00:00" "10:01:00" "10:02:00" "10:03:00" "10:04:00" "10:05:00"
## [7] "10:06:00" "10:07:00" "10:09:00" "10:10:00" "10:11:00" "10:12:00"
## [13] "10:14:00" "10:15:00" "10:16:00" "10:18:00" "10:20:00" "10:21:00"
## [19] "10:23:00" "10:24" "10:24:00" "10:25:00" "10:27:00" "10:28:00"
## [25] "10:29:00" "10:30" "10:30:00" "10:32:00" "10:34:00" "10:36:00"
## [31] "10:39:00" "10:40:00" "10:41:00" "10:43:00" "10:44:00" "10:45:00"
## [37] "10:47:00" "10:48:00" "10:49:00" "10:50:00" "10:51:00" "10:52:00"
## [43] "10:54:00" "10:55:00" "10:56:00" "10:57" "10:57:00" "10:59:00"
## [49] "11:00" "11:00:00" "11:01:00" "11:02:00" "11:03:00" "11:05:00"
## [55] "11:06:00" "11:08" "11:08:00" "11:09:00" "11:10:00" "11:12:00"
## [61] "11:15:00" "11:16:00" "11:17:00" "11:18:00" "11:19:00" "11:20:00"
## [67] "11:21:00" "11:23:00" "11:24:00" "11:25:00" "11:26:00" "11:27:00"
## [73] "11:28:00" "11:29" "11:30:00" "11:31:00" "11:32:00" "11:33:00"
## [79] "11:35:00" "11:36:00" "11:37:00" "11:38" "11:38:00" "11:39:00"
## [85] "11:40:00" "11:41:00" "11:42:00" "11:44:00" "11:45:00" "11:46:00"
## [91] "11:47:00" "11:48:00" "11:50:00" "11:53:00" "11:54:00" "11:55:00"
## [97] "11:56:00" "11:57" "11:57:00" "11:58:00" "12:00:00" "12:02:00"
## [103] "12:04:00" "12:05:00" "12:06:00" "12:07:00" "12:08:00" "12:09:00"
## [109] "12:10:00" "12:11:00" "12:13:00" "12:17:00" "12:18:00" "12:20:00"
## [115] "12:24:00" "12:26:00" "12:27:00" "12:29:00" "12:30:00" "12:31:00"
## [121] "12:33:00" "12:34:00" "12:35:00" "12:36:00" "12:38:00" "12:40"
## [127] "12:40:00" "12:42:00" "12:44:00" "12:45" "12:45:00" "12:47:00"
## [133] "12:48:00" "12:49:00" "12:51:00" "12:52:00" "12:53:00" "12:54:00"
## [139] "12:56:00" "12:57:00" "12:58:00" "13:00:00" "13:01:00" "13:02:00"
## [145] "13:05:00" "13:07:00" "13:08:00" "13:09:00" "13:10" "13:11:00"
## [151] "13:12:00" "13:13:00" "13:14" "13:14:00" "13:18:00" "13:20:00"
## [157] "13:22:00" "13:25:00" "13:26:00" "13:33:00" "13:35:00" "13:38:00"
## [163] "13:39:00" "13:40:00" "13:41:00" "13:42:00" "13:43:00" "13:45:00"
## [169] "13:46:00" "13:47:00" "13:48" "13:48:00" "13:49:00" "13:50:00"
## [175] "13:51:00" "13:52" "13:53:00" "13:54:00" "13:56:00" "13:57:00"
## [181] "13:58:00" "13:59:00" "14:01:00" "14:02:00" "14:03:00" "14:05:00"
## [187] "14:06:00" "14:08:00" "14:09:00" "14:10:00" "14:11" "14:12:00"
## [193] "14:14:00" "14:15:00" "14:17:00" "14:19:00" "14:20:00" "14:21:00"
## [199] "14:23:00" "14:24:00" "14:26:00" "14:28:00" "14:29:00" "14:30:00"
## [205] "14:31:00" "14:32:00" "14:33:00" "14:35:00" "14:37:00" "14:39:00"
## [211] "14:41:00" "14:42:00" "14:43:00" "14:44:00" "14:46:00" "14:48:00"
## [217] "14:50:00" "14:51:00" "14:55:00" "14:56:00" "14:57:00" "14:59:00"
## [223] "15:00:00" "15:04:00" "15:06" "15:06:00" "15:09:00" "15:10:00"
## [229] "15:11:00" "15:14:00" "15:15:00" "15:16:00" "15:18" "15:20:00"
## [235] "15:22:00" "15:23:00" "15:24:00" "15:26:00" "15:27:00" "15:28:00"
## [241] "15:29:00" "15:31:00" "15:34:00" "15:36:00" "15:38:00" "15:39:00"
## [247] "15:40" "15:41" "15:41:00" "15:42" "15:42:00" "15:44"
## [253] "15:44:00" "15:45:00" "15:47:00" "15:48:00" "15:49" "15:49:00"
## [259] "15:50:00" "15:51:00" "15:52" "15:55" "16:00" "16:02:00"
## [265] "16:06" "16:06:00" "16:07" "16:09" "16:09:00" "16:10:00"
## [271] "16:12:00" "16:14:00" "16:16:00" "16:17:00" "16:18:00" "16:19"
## [277] "16:20" "16:21:00" "16:23:00" "16:25" "16:26:00" "16:27"
## [283] "16:27:00" "16:29:00" "16:30" "16:30:00" "16:32:00" "16:36:00"
## [289] "16:37:00" "16:38" "16:39" "16:39:00" "16:40" "16:46:00"
## [295] "16:47:00" "16:48" "16:48:00" "16:49" "16:50" "16:53"
## [301] "16:53:00" "16:55:00" "16:56:00" "16:57:00" "16:59" "16:59:00"
## [307] "17:00" "17:02" "17:02:00" "17:04" "17:04:00" "17:05:00"
## [313] "17:06:00" "17:07:00" "17:08:00" "17:10:00" "17:11:00" "17:12"
## [319] "17:12:00" "17:13" "17:16" "17:17:00" "17:18:00" "17:20:00"
## [325] "17:21" "17:21:00" "17:23:00" "17:25" "17:26" "17:26:00"
## [331] "17:28:00" "17:29" "17:29:00" "17:31" "17:31:00" "17:32:00"
## [337] "17:35" "17:38:00" "17:39:00" "17:40" "17:41" "17:41:00"
## [343] "17:43:00" "17:45:00" "17:46:00" "17:47:00" "17:48" "17:50:00"
## [349] "17:51:00" "17:52:00" "17:54" "17:54:00" "17:56" "17:56:00"
## [355] "17:58" "17:58:00" "17:59:00" "18:00:00" "18:01" "18:01:00"
## [361] "18:03:00" "18:04" "18:05:00" "18:07" "18:08" "18:10"
## [367] "18:11:00" "18:13:00" "18:15:00" "18:16:00" "18:18" "18:20:00"
## [373] "18:21:00" "18:23:00" "18:26:00" "18:27:00" "18:29:00" "18:31:00"
## [379] "18:32:00" "18:33:00" "18:34" "18:36" "18:38:00" "18:40"
## [385] "18:42:00" "18:44:00" "18:46" "18:49:00" "18:50:00" "18:54"
## [391] "18:55:00" "18:56:00" "18:57:00" "18:58:00" "18:59:00" "19:00:00"
## [397] "19:01:00" "19:04:00" "19:05:00" "19:06:00" "19:08" "19:09:00"
## [403] "19:14:00" "19:15:00" "19:16" "19:16:00" "19:22" "19:24"
## [409] "19:24:00" "19:25:00" "19:27:00" "19:28:00" "19:30" "19:30:00"
## [415] "19:31:00" "19:33" "19:34" "19:34:00" "19:35:00" "19:36:00"
## [421] "19:37:00" "19:43:00" "19:44" "19:45:00" "19:46" "19:46:00"
## [427] "19:48:00" "19:50" "19:51:00" "19:52:00" "19:55:00" "19:57:00"
## [433] "20:01" "20:05:00" "20:06" "20:06:00" "20:08" "20:10"
## [439] "20:10:00" "20:17:00" "20:18:00" "20:40:00" "6:40:00" "6:45:00"
## [445] "6:48:00" "7:00:00" "7:01:00" "7:06:00" "7:13:00" "7:14:00"
## [451] "7:16:00" "7:18:00" "7:20:00" "7:21:00" "7:25:00" "7:26:00"
## [457] "7:28:00" "7:32:00" "7:33:00" "7:34:00" "7:36:00" "7:40:00"
## [463] "7:47:00" "7:49:00" "7:53:00" "7:55:00" "7:59:00" "8:01:00"
## [469] "8:03:00" "8:06:00" "8:08:00" "8:10:00" "8:19:00" "8:22:00"
## [475] "8:27:00" "8:29:00" "8:31:00" "8:32:00" "8:38:00" "8:41:00"
## [481] "8:44:00" "8:45:00" "8:52:00" "8:55:00" "8:56:00" "8:58:00"
## [487] "8:59:00" "9:02:00" "9:04:00" "9:06:00" "9:08:00" "9:09:00"
## [493] "9:10:00" "9:11:00" "9:12:00" "9:13:00" "9:15:00" "9:17:00"
## [499] "9:18:00" "9:20:00" "9:22:00" "9:24:00" "9:25:00" "9:26:00"
## [505] "9:27:00" "9:28:00" "9:34:00" "9:36:00" "9:37:00" "9:38:00"
## [511] "9:39:00" "9:40:00" "9:42:00" "9:43:00" "9:46:00" "9:47:00"
## [517] "9:48:00" "9:49:00" "9:51" "9:53:00" "9:54:00"
# Time of day
reptiles$time <- as.character(reptiles$time)
class(reptiles$time) # character
## [1] "character"
reptiles[is.na(time)] # No missing observation times
## Empty data.table (0 rows and 51 cols): site,point_name,campaign,year,unit,subunit...
reptiles[, .(no.of.times = uniqueN(time)), keyby = .(unit, campaign, site, point_name)][no.of.times > 1] # There are often multiple times per survey ID - we should take the earliest one
## unit campaign site
## 1: Coastal Plain Sands T0 Ashdod
## 2: Coastal Plain Sands T0 Ashdod
## 3: Coastal Plain Sands T0 Ashdod
## 4: Coastal Plain Sands T0 Ashdod
## 5: Coastal Plain Sands T0 Ashdod
## 6: Coastal Plain Sands T0 Ashdod
## 7: Coastal Plain Sands T0 Ashdod
## 8: Coastal Plain Sands T0 Ashdod
## 9: Coastal Plain Sands T0 Ashdod
## 10: Coastal Plain Sands T0 Ashkelon
## 11: Coastal Plain Sands T0 Ashkelon
## 12: Coastal Plain Sands T0 Ashkelon
## 13: Coastal Plain Sands T0 Ashkelon
## 14: Coastal Plain Sands T0 Ashkelon
## 15: Coastal Plain Sands T0 Netiv Haasara
## 16: Coastal Plain Sands T0 Netiv Haasara
## 17: Coastal Plain Sands T0 Netiv Haasara
## 18: Coastal Plain Sands T0 Netiv Haasara
## 19: Coastal Plain Sands T0 Netiv Haasara
## 20: Coastal Plain Sands T0 Netiv Haasara
## 21: Coastal Plain Sands T1 Ashdod
## 22: Coastal Plain Sands T1 Ashkelon
## 23: Coastal Plain Sands T1 Zikim
## 24: Coastal Plain Sands T1 Zikim
## 25: Loess Covered Areas in the Northern Negev T0 Eshel Hanasi
## 26: Loess Covered Areas in the Northern Negev T0 Eshel Hanasi
## 27: Loess Covered Areas in the Northern Negev T0 Givot Bar
## 28: Loess Covered Areas in the Northern Negev T0 Givot Bar
## 29: Loess Covered Areas in the Northern Negev T0 Givot Bar
## 30: Loess Covered Areas in the Northern Negev T0 Mishmar Hanegev
## 31: Loess Covered Areas in the Northern Negev T0 Mishmar Hanegev
## 32: Loess Covered Areas in the Northern Negev T0 Mishmar Hanegev
## 33: Loess Covered Areas in the Northern Negev T0 Mishmar Hanegev
## 34: Loess Covered Areas in the Northern Negev T0 Nahal Ashan
## 35: Loess Covered Areas in the Northern Negev T0 Nahal Ashan
## 36: Loess Covered Areas in the Northern Negev T0 Nahal Ashan
## 37: Loess Covered Areas in the Northern Negev T0 Park Loess
## 38: Loess Covered Areas in the Northern Negev T0 Park Loess
## 39: Loess Covered Areas in the Northern Negev T0 Park Loess
## 40: Mediterranean-Desert Transition Zone T0 Beit Yatir
## 41: Mediterranean-Desert Transition Zone T0 Beit Yatir
## 42: Mediterranean-Desert Transition Zone T0 Beit Yatir
## 43: Mediterranean-Desert Transition Zone T0 Beit Yatir
## 44: Mediterranean-Desert Transition Zone T0 Beit Yatir
## 45: Mediterranean-Desert Transition Zone T0 Beit Yatir
## 46: Mediterranean-Desert Transition Zone T0 Har Amasa
## 47: Mediterranean-Desert Transition Zone T0 Har Amasa
## 48: Mediterranean-Desert Transition Zone T0 Har Amasa
## 49: Mediterranean-Desert Transition Zone T0 Lahav
## 50: Mediterranean-Desert Transition Zone T0 Lahav
## 51: Mediterranean-Desert Transition Zone T0 Lehavim
## 52: Mediterranean-Desert Transition Zone T0 Lehavim
## 53: Mediterranean-Desert Transition Zone T0 Lehavim
## 54: Mediterranean-Desert Transition Zone T0 Mirsham
## 55: Mediterranean-Desert Transition Zone T0 Mirsham
## 56: Mediterranean-Desert Transition Zone T0 Mirsham
## 57: Mediterranean-Desert Transition Zone T0 Mirsham
## 58: Planted Conifer Forests T0 Aderet
## 59: Planted Conifer Forests T0 Aderet
## 60: Planted Conifer Forests T0 Amatzia
## 61: Planted Conifer Forests T0 Amatzia
## 62: Planted Conifer Forests T0 Bat Shlomo
## 63: Planted Conifer Forests T0 Elyakim
## 64: Planted Conifer Forests T0 Elyakim
## 65: Planted Conifer Forests T0 Givat Yeshayahu
## 66: Planted Conifer Forests T0 Kabri
## 67: Planted Conifer Forests T0 Kerem Maharal
## 68: Planted Conifer Forests T0 Manara
## 69: Planted Conifer Forests T0 Ramot Naftali
## 70: Planted Conifer Forests T0 Ramot Naftali
## 71: Planted Conifer Forests T0 Zuriel
## 72: Planted Conifer Forests T0 Zuriel
## unit campaign site
## point_name no.of.times
## 1: Ashdod Far Semi-Shifting 1 3
## 2: Ashdod Far Semi-Shifting 2 4
## 3: Ashdod Far Semi-Shifting 3 5
## 4: Ashdod Far shifting 1 3
## 5: Ashdod Far shifting 2 3
## 6: Ashdod Far shifting 3 4
## 7: Ashdod Near semi-shifting 1 3
## 8: Ashdod Near semi-shifting 2 2
## 9: Ashdod Near semi-shifting 3 3
## 10: Ashkelon Far semi-shifting 1 5
## 11: Ashkelon Far semi-shifting 3 2
## 12: Ashkelon Far shifting 1 2
## 13: Ashkelon Far shifting 3 3
## 14: Ashkelon Near semi-shifting 2 8
## 15: Netiv Haasara Far semi-shifting 1 2
## 16: Netiv Haasara Far semi-shifting 2 2
## 17: Netiv Haasara Far shifting 1 2
## 18: Netiv Haasara Far shifting 2 3
## 19: Netiv Haasara Far shifting 3 3
## 20: Netiv Haasara Near semi-shifting 1 2
## 21: Ashdod Far Semi-Shifting 1 2
## 22: Ashkelon Far Shifting 2 2
## 23: Zikim Far semi-shifting 3 2
## 24: Zikim Near semi-shifting 1 2
## 25: Eshel Hanasi bedouin agriculture 31.33814194_34.71648947 6
## 26: Eshel Hanasi bedouin agriculture 31.34189216_34.7090606 2
## 27: Givot Bar bedouin agriculture 31.36034694_34.75049867 4
## 28: Givot Bar bedouin agriculture 31.36423692_34.75671353 5
## 29: Givot Bar bedouin agriculture 31.37352221_34.77122583 3
## 30: Mishmar Hanegev bedouin agriculture 31.35953705_34.74353936 5
## 31: Mishmar Hanegev bedouin agriculture 31.36963753_34.74636994 2
## 32: Mishmar Hanegev bedouin agriculture 31.37129176_34.73660277 4
## 33: Mishmar Hanegev kkl plantings 31.36493851_34.72983363 2
## 34: Nahal Ashan kkl plantings 31.28265003_34.74862372 2
## 35: Nahal Ashan loess 31.28245503_34.75764806 5
## 36: Nahal Ashan loess 31.29271253_34.76700752 2
## 37: Park Loess loess 31.21706343_34.57620702 9
## 38: Park Loess loess 31.22728013_34.60140018 11
## 39: Park Loess loess 31.24477105_34.60143498 11
## 40: Beit Yatir Far 31.35013846_35.11235947 2
## 41: Beit Yatir Far 31.35114151_35.12245726 2
## 42: Beit Yatir Far 31.36048202_35.13023961 5
## 43: Beit Yatir Near 31.35936566_35.11638381 9
## 44: Beit Yatir Near 31.3616697_35.10994797 5
## 45: Beit Yatir Near 31.36983666_35.11023255 3
## 46: Har Amasa Far 31.33245149_35.10733619 3
## 47: Har Amasa Far 31.35044064_35.12192146 2
## 48: Har Amasa Near 31.3435548_35.10418644 4
## 49: Lahav Near 31.38116555_34.87381881 3
## 50: Lahav Near 31.38184847_34.86639343 9
## 51: Lehavim Far 31.3350892_34.83998961 2
## 52: Lehavim Far 31.35798817_34.84029091 3
## 53: Lehavim Near 31.36815471_34.82319744 2
## 54: Mirsham Far 31.45827683_34.90100711 3
## 55: Mirsham Far 31.5002719_34.92750673 4
## 56: Mirsham Far 31.50077347_34.93924637 4
## 57: Mirsham Near 31.47629966_34.92475669 6
## 58: Aderet 31.67145208_34.98801954 2
## 59: Aderet 31.67578059_34.98668299 2
## 60: Amatzia 31.50752022_34.89495214 2
## 61: Amatzia 31.51244878_34.8934848 3
## 62: Bat Shlomo 32.58718195_35.01053736 3
## 63: Elyakim 32.66706551_35.05568276 2
## 64: Elyakim 32.66729268_35.06300807 2
## 65: Givat Yeshayahu 31.66774825_34.92543564 2
## 66: Kabri 33.02026699_35.15765825 2
## 67: Kerem Maharal 32.61292488_34.96995645 4
## 68: Manara 33.17320998_35.5510869 2
## 69: Ramot Naftali 33.09405282_35.56702946 2
## 70: Ramot Naftali 33.09853595_35.56487564 2
## 71: Zuriel 33.01092878_35.31488161 4
## 72: Zuriel 33.013998_35.31735071 2
## point_name no.of.times
reptiles[is.na(as.ITime(time)) & !is.na(time)] # this conversion will produce no NAs
## Empty data.table (0 rows and 51 cols): site,point_name,campaign,year,unit,subunit...
bla <- copy(reptiles)
bla[, ITime := as.ITime(time, tz = 'Asia/Jerusalem')]
class(bla$ITime) # Should be ITime
## [1] "ITime"
bla[, .(time = unique(time)), keyby = .(ITime)] # this seems ok
## ITime time
## 1: 06:40:00 6:40:00
## 2: 06:45:00 6:45:00
## 3: 06:48:00 6:48:00
## 4: 07:00:00 7:00:00
## 5: 07:01:00 7:01:00
## ---
## 517: 20:10:00 20:10:00
## 518: 20:10:00 20:10
## 519: 20:17:00 20:17:00
## 520: 20:18:00 20:18:00
## 521: 20:40:00 20:40:00
bla[, start_Time := min(ITime), keyby = .(unit, campaign, Date, point_name)] # Take the earliest time per survey
bla[, .(no.of.start_times = uniqueN(start_Time)), keyby = .(unit, campaign, site, point_name)][no.of.start_times > 1] # Now there is only one start time per survey
## Empty data.table (0 rows and 5 cols): unit,campaign,site,point_name,no.of.start_times
bla[start_Time > ITime] # sanity check: start time is never before the observation time - makes sense!
## Empty data.table (0 rows and 53 cols): site,point_name,campaign,year,unit,subunit...
bla[is.na(start_Time)]
## Empty data.table (0 rows and 53 cols): site,point_name,campaign,year,unit,subunit...
bla[as.ITime(time) == ITime, .N] # 2752 cases where time is identical to ITime
## [1] 2752
bla[as.ITime(time) != ITime, .N] # 0 cases where it is not
## [1] 0
bla[is.na(ITime)] # no missing times
## Empty data.table (0 rows and 53 cols): site,point_name,campaign,year,unit,subunit...
reptiles <- copy(bla)
rm(bla)
reptiles[, .(ITime2 = as.ITime(ifelse(is.na(ITime), unique(as.ITime(time, tz = 'Asia/Jerusalem')), ITime))), keyby = .(time, ITime)] # seems reasonable
## time ITime ITime2
## 1: 10:00:00 10:00:00 10:00:00
## 2: 10:01:00 10:01:00 10:01:00
## 3: 10:02:00 10:02:00 10:02:00
## 4: 10:03:00 10:03:00 10:03:00
## 5: 10:04:00 10:04:00 10:04:00
## ---
## 517: 9:48:00 09:48:00 09:48:00
## 518: 9:49:00 09:49:00 09:49:00
## 519: 9:51 09:51:00 09:51:00
## 520: 9:53:00 09:53:00 09:53:00
## 521: 9:54:00 09:54:00 09:54:00
reptiles[is.na(time) & is.na(as.ITime(ifelse(is.na(ITime), unique(as.ITime(time, tz = 'Asia/Jerusalem')), ITime)))] # no missing times
## Empty data.table (0 rows and 53 cols): site,point_name,campaign,year,unit,subunit...
setorder(reptiles, unit, campaign, site, agriculture, settlements, dunes, point_name, start_Time, ITime)
hist(reptiles[, as.numeric(ITime)], breaks = 24) # X axis is meaningless, but other wise this seems ok
quantile(reptiles$ITime) # Times should not be in UTC though
## [1] "06:40:00" "11:39:00" "16:09:30" "18:04:00" "20:40:00"
class(reptiles$start_Time) # should be ITime
## [1] "integer"
reptiles[, .(start_ITime = unique(as.ITime(start_Time, tz = 'Asia/Jerusalem'))), keyby = start_Time] # seems ok
## start_Time start_ITime
## 1: 24000 06:40:00
## 2: 24300 06:45:00
## 3: 24480 06:48:00
## 4: 25200 07:00:00
## 5: 25260 07:01:00
## ---
## 428: 72480 20:08:00
## 429: 72600 20:10:00
## 430: 73020 20:17:00
## 431: 73080 20:18:00
## 432: 74400 20:40:00
reptiles[, start_Time := as.ITime(start_Time, tz = 'Asia/Jerusalem')]
# Express diel pattern as the sine and cosine of the distance in radians from noon
reptiles[, .(unique(as.POSIXct(paste(Date, time, tz = 'Asia/Jerusalem')))), keyby = .(Date, start_Time)] # seems ok
## Date start_Time V1
## 1: 2014-04-16 09:54:00 2014-04-16 09:54:00
## 2: 2014-04-16 09:54:00 2014-04-16 10:18:00
## 3: 2014-04-16 09:54:00 2014-04-16 10:21:00
## 4: 2014-04-16 11:10:00 2014-04-16 11:10:00
## 5: 2014-04-16 11:10:00 2014-04-16 11:19:00
## ---
## 808: 2021-10-15 17:56:00 2021-10-15 17:56:00
## 809: 2021-10-15 18:07:00 2021-10-15 18:07:00
## 810: 2021-10-15 18:36:00 2021-10-15 18:36:00
## 811: 2021-10-15 18:46:00 2021-10-15 18:46:00
## 812: 2021-10-15 19:30:00 2021-10-15 19:30:00
reptiles[, Date.time := as.POSIXct(paste(Date, start_Time, tz = 'Asia/Jerusalem'))] # Create a Date and time object
class(reptiles$Date.time) # should be POSIXct
## [1] "POSIXct" "POSIXt"
reptiles[, .(unique(as.POSIXct(paste(Date, '12:00:00', tz = 'Asia/Jerusalem')))), keyby = .(Date, ITime)]
## Date ITime V1
## 1: 2014-04-16 09:54:00 2014-04-16 12:00:00
## 2: 2014-04-16 10:18:00 2014-04-16 12:00:00
## 3: 2014-04-16 10:21:00 2014-04-16 12:00:00
## 4: 2014-04-16 11:10:00 2014-04-16 12:00:00
## 5: 2014-04-16 11:19:00 2014-04-16 12:00:00
## ---
## 808: 2021-10-15 17:56:00 2021-10-15 12:00:00
## 809: 2021-10-15 18:07:00 2021-10-15 12:00:00
## 810: 2021-10-15 18:36:00 2021-10-15 12:00:00
## 811: 2021-10-15 18:46:00 2021-10-15 12:00:00
## 812: 2021-10-15 19:30:00 2021-10-15 12:00:00
reptiles[, .(dst(Date))][V1 == T] # From some reason day light saving time is not recognized in the Date field
## Empty data.table (0 rows and 1 cols): V1
reptiles[, .(dst(Date.time))][V1 == T, .N] # but it is recognized for Date.time
## [1] 2672
reptiles[, .(dst(Date.time)), keyby = .(Date.time)][V1 == F] # Only November and late March Dates are not in daylight saving time
## Date.time V1
## 1: 2015-11-03 10:36:00 FALSE
## 2: 2015-11-03 11:06:00 FALSE
## 3: 2015-11-03 11:54:00 FALSE
## 4: 2015-11-03 13:14:00 FALSE
## 5: 2015-11-03 13:42:00 FALSE
## 6: 2015-11-04 14:44:00 FALSE
## 7: 2015-11-04 15:23:00 FALSE
## 8: 2015-11-04 15:48:00 FALSE
## 9: 2015-11-15 10:12:00 FALSE
## 10: 2015-11-15 10:43:00 FALSE
## 11: 2015-11-15 11:18:00 FALSE
## 12: 2015-11-25 11:10:00 FALSE
## 13: 2015-11-25 11:41:00 FALSE
## 14: 2015-11-25 15:20:00 FALSE
## 15: 2020-03-24 10:51:00 FALSE
## 16: 2020-03-24 11:47:00 FALSE
## 17: 2020-03-24 12:17:00 FALSE
## 18: 2020-03-24 13:00:00 FALSE
## 19: 2020-03-24 14:28:00 FALSE
## 20: 2020-03-24 15:26:00 FALSE
head(reptiles[, .(Date.time, Date.time - 3600)]) # as the time units are seconds, to revert one hour we need to subtract 3600 units from Date.time
## Date.time V2
## 1: 2014-09-30 09:43:00 2014-09-30 08:43:00
## 2: 2014-09-30 09:43:00 2014-09-30 08:43:00
## 3: 2014-09-30 09:43:00 2014-09-30 08:43:00
## 4: 2014-09-30 09:43:00 2014-09-30 08:43:00
## 5: 2014-09-30 11:30:00 2014-09-30 10:30:00
## 6: 2014-09-30 11:30:00 2014-09-30 10:30:00
attr(reptiles$Date.time, 'tzone') # Time zone is not set
## [1] ""
attr(reptiles$Date.time, 'tzone') <- 'Asia/Jerusalem' # set time zone
reptiles[, ':=' (Date.time = ifelse(dst(Date.time), Date.time - 3600, Date.time),
ITime = ifelse(dst(Date.time), as.ITime(as.ITime(time) - 3600), as.ITime(ITime)))]
reptiles[, ':=' (Date.time = as.POSIXct(Date.time), ITime = as.ITime(ITime))]
reptiles[, .(site, dunes, point_name, Date, start_Time, time, Date.time, ITime)] # Note that the Date.time and ITime are often one hour before the reported time, because it was set to non-daylight saving time
## site dunes point_name Date
## 1: Ashdod semi-shifting Ashdod Far Semi-Shifting 1 2014-09-30
## 2: Ashdod semi-shifting Ashdod Far Semi-Shifting 1 2014-09-30
## 3: Ashdod semi-shifting Ashdod Far Semi-Shifting 1 2014-09-30
## 4: Ashdod semi-shifting Ashdod Far Semi-Shifting 1 2014-09-30
## 5: Ashdod semi-shifting Ashdod Far Semi-Shifting 2 2014-09-30
## ---
## 2748: Ramot Naftali <NA> Ramot Naftali KKL Plantings 1 2021-05-05
## 2749: Ramot Naftali <NA> Ramot Naftali KKL Plantings 2 2021-05-05
## 2750: Ramot Naftali <NA> Ramot Naftali KKL Plantings 3 2021-05-05
## 2751: Ramot Naftali <NA> Ramot Naftali KKL Plantings 3 2021-05-05
## 2752: Zuriel <NA> Zuriel KKL Plantings 2 2021-06-23
## start_Time time Date.time ITime
## 1: 09:43:00 9:43:00 2014-09-30 08:43:00 08:43:00
## 2: 09:43:00 9:43:00 2014-09-30 08:43:00 08:43:00
## 3: 09:43:00 9:49:00 2014-09-30 08:43:00 08:49:00
## 4: 09:43:00 12:51:00 2014-09-30 08:43:00 11:51:00
## 5: 11:30:00 11:30:00 2014-09-30 10:30:00 10:30:00
## ---
## 2748: 16:59:00 16:59 2021-05-05 15:59:00 15:59:00
## 2749: 18:08:00 18:08 2021-05-05 17:08:00 17:08:00
## 2750: 17:35:00 17:35 2021-05-05 16:35:00 16:35:00
## 2751: 17:35:00 17:35 2021-05-05 16:35:00 16:35:00
## 2752: 17:48:00 17:48 2021-06-23 16:48:00 16:48:00
# Missing plots:----
study.design <- as.data.table(read_excel('Analysis/Study design.xlsx')) # Import the study design - how many plots per site etc.
surveyed.plots <- reptiles[, .(no.of.surveyed.plots = uniqueN(point_name)), keyby = .(campaign, unit, subunit, site, settlements, agriculture, dunes, habitat)]
surveyed.plots
## campaign unit subunit site
## 1: T0 Coastal Plain Sands <NA> Ashdod
## 2: T0 Coastal Plain Sands <NA> Ashdod
## 3: T0 Coastal Plain Sands <NA> Ashdod
## 4: T0 Coastal Plain Sands <NA> Ashkelon
## 5: T0 Coastal Plain Sands <NA> Ashkelon
## ---
## 227: T4 Planted Conifer Forests Judean Highlands Aderet
## 228: T4 Planted Conifer Forests Judean Highlands Amatzia
## 229: T4 Planted Conifer Forests Judean Highlands Eitanim
## 230: T4 Planted Conifer Forests Judean Highlands Eshtaol
## 231: T4 Planted Conifer Forests Judean Highlands Givat Yeshayahu
## settlements agriculture dunes habitat no.of.surveyed.plots
## 1: Far <NA> semi-shifting <NA> 3
## 2: Far <NA> shifting <NA> 3
## 3: Near <NA> semi-shifting <NA> 3
## 4: Far <NA> semi-shifting <NA> 3
## 5: Far <NA> shifting <NA> 3
## ---
## 227: <NA> <NA> <NA> <NA> 3
## 228: <NA> <NA> <NA> <NA> 3
## 229: <NA> <NA> <NA> <NA> 1
## 230: <NA> <NA> <NA> <NA> 3
## 231: <NA> <NA> <NA> <NA> 3
surveyed.planned.plots <- merge(study.design, surveyed.plots, by = c('unit', 'subunit', 'site', 'settlements', 'agriculture', 'dunes', 'habitat'), all = T)
surveyed.planned.plots[is.na(no.of.planned.plots)] # One site, Hatzerim, was surveyed although it does not appear on the protocols
## Empty data.table (0 rows and 14 cols): unit,subunit,site,settlements,agriculture,dunes...
surveyed.planned.plots[is.na(no.of.surveyed.plots)] # No sites have no plots
## Empty data.table (0 rows and 14 cols): unit,subunit,site,settlements,agriculture,dunes...
missing.excessive.plots <- surveyed.planned.plots[no.of.surveyed.plots != no.of.planned.plots, # Find sites where the number of surveyed plots is different from the number of planned plots
.(campaign, unit, subunit, site, settlements, dunes, habitat, agriculture, no.of.planned.plots, no.of.surveyed.plots)]
setorder(missing.excessive.plots, campaign, unit, subunit, site, settlements, dunes, habitat, agriculture)
missing.excessive.plots[, delta.plots := no.of.surveyed.plots - no.of.planned.plots] # negative values mean missing plots and vice versa
missing.excessive.plots
## campaign unit subunit
## 1: T0 Coastal Plain Sands <NA>
## 2: T0 Coastal Plain Sands <NA>
## 3: T0 Coastal Plain Sands <NA>
## 4: T0 Loess Covered Areas in the Northern Negev <NA>
## 5: T0 Loess Covered Areas in the Northern Negev <NA>
## 6: T0 Loess Covered Areas in the Northern Negev <NA>
## 7: T0 Loess Covered Areas in the Northern Negev <NA>
## 8: T0 Mediterranean-Desert Transition Zone <NA>
## 9: T0 Mediterranean-Desert Transition Zone <NA>
## 10: T0 Mediterranean-Desert Transition Zone <NA>
## 11: T0 Planted Conifer Forests Carmel
## 12: T0 Planted Conifer Forests Carmel
## 13: T0 Planted Conifer Forests Carmel
## 14: T0 Planted Conifer Forests Galilee
## 15: T0 Planted Conifer Forests Galilee
## 16: T0 Planted Conifer Forests Judean Highlands
## 17: T0 Planted Conifer Forests Judean Highlands
## 18: T0 Planted Conifer Forests Judean Highlands
## 19: T0 Planted Conifer Forests Judean Highlands
## 20: T1 Coastal Plain Sands <NA>
## 21: T1 Coastal Plain Sands <NA>
## 22: T1 Loess Covered Areas in the Northern Negev <NA>
## 23: T1 Mediterranean-Desert Transition Zone <NA>
## 24: T1 Mediterranean-Desert Transition Zone <NA>
## 25: T1 Planted Conifer Forests Carmel
## 26: T1 Planted Conifer Forests Carmel
## 27: T1 Planted Conifer Forests Carmel
## 28: T1 Planted Conifer Forests Carmel
## 29: T1 Planted Conifer Forests Galilee
## 30: T1 Planted Conifer Forests Galilee
## 31: T1 Planted Conifer Forests Galilee
## 32: T1 Planted Conifer Forests Judean Highlands
## 33: T1 Planted Conifer Forests Judean Highlands
## 34: T2 Loess Covered Areas in the Northern Negev <NA>
## 35: T2 Loess Covered Areas in the Northern Negev <NA>
## 36: T2 Loess Covered Areas in the Northern Negev <NA>
## 37: T2 Loess Covered Areas in the Northern Negev <NA>
## 38: T2 Planted Conifer Forests Carmel
## 39: T2 Planted Conifer Forests Galilee
## 40: T2 Planted Conifer Forests Galilee
## 41: T2 Planted Conifer Forests Judean Highlands
## 42: T3 Coastal Plain Sands <NA>
## 43: T3 Loess Covered Areas in the Northern Negev <NA>
## 44: T3 Loess Covered Areas in the Northern Negev <NA>
## 45: T3 Loess Covered Areas in the Northern Negev <NA>
## 46: T3 Loess Covered Areas in the Northern Negev <NA>
## 47: T3 Loess Covered Areas in the Northern Negev <NA>
## 48: T3 Loess Covered Areas in the Northern Negev <NA>
## 49: T3 Planted Conifer Forests Carmel
## 50: T3 Planted Conifer Forests Galilee
## 51: T3 Planted Conifer Forests Galilee
## 52: T3 Planted Conifer Forests Galilee
## 53: T3 Planted Conifer Forests Judean Highlands
## 54: T4 Planted Conifer Forests Galilee
## 55: T4 Planted Conifer Forests Galilee
## 56: T4 Planted Conifer Forests Judean Highlands
## campaign unit subunit
## site settlements dunes habitat agriculture
## 1: Netiv Haasara Far semi-shifting <NA> <NA>
## 2: Netiv Haasara Far shifting <NA> <NA>
## 3: Netiv Haasara Near semi-shifting <NA> <NA>
## 4: Eshel Hanasi <NA> <NA> bedouin agriculture <NA>
## 5: Mishmar Hanegev <NA> <NA> kkl plantings <NA>
## 6: Nahal Ashan <NA> <NA> kkl plantings <NA>
## 7: Sayeret Shaked <NA> <NA> kkl plantings <NA>
## 8: Lahav Far <NA> <NA> <NA>
## 9: Lehavim Far <NA> <NA> <NA>
## 10: Lehavim Near <NA> <NA> <NA>
## 11: Bat Shlomo <NA> <NA> <NA> <NA>
## 12: Kerem Maharal <NA> <NA> <NA> <NA>
## 13: Ofer <NA> <NA> <NA> <NA>
## 14: Manara <NA> <NA> <NA> <NA>
## 15: Zuriel <NA> <NA> <NA> <NA>
## 16: Aderet <NA> <NA> <NA> <NA>
## 17: Eitanim <NA> <NA> <NA> <NA>
## 18: Eshtaol <NA> <NA> <NA> <NA>
## 19: Givat Yeshayahu <NA> <NA> <NA> <NA>
## 20: Ashdod Far shifting <NA> <NA>
## 21: Zikim Far shifting <NA> <NA>
## 22: Goral <NA> <NA> bedouin agriculture <NA>
## 23: Lehavim Near <NA> <NA> <NA>
## 24: Mirsham Near <NA> <NA> <NA>
## 25: Bat Shlomo <NA> <NA> <NA> <NA>
## 26: Kerem Maharal <NA> <NA> <NA> <NA>
## 27: Ofer <NA> <NA> <NA> <NA>
## 28: Ramat Hashofet <NA> <NA> <NA> <NA>
## 29: Manara <NA> <NA> <NA> <NA>
## 30: Meron <NA> <NA> <NA> <NA>
## 31: Zuriel <NA> <NA> <NA> <NA>
## 32: Eitanim <NA> <NA> <NA> <NA>
## 33: Eshtaol <NA> <NA> <NA> <NA>
## 34: Eshel Hanasi <NA> <NA> bedouin agriculture <NA>
## 35: Givot Bar <NA> <NA> bedouin agriculture <NA>
## 36: Nahal Ashan <NA> <NA> loess <NA>
## 37: Park Loess <NA> <NA> loess <NA>
## 38: Ramat Hashofet <NA> <NA> <NA> <NA>
## 39: Manara <NA> <NA> <NA> <NA>
## 40: Zuriel <NA> <NA> <NA> <NA>
## 41: Eitanim <NA> <NA> <NA> <NA>
## 42: Caesarea Near semi-shifting <NA> <NA>
## 43: Eshel Hanasi <NA> <NA> bedouin agriculture <NA>
## 44: Givot Bar <NA> <NA> bedouin agriculture <NA>
## 45: Goral <NA> <NA> bedouin agriculture <NA>
## 46: Mishmar Hanegev <NA> <NA> kkl plantings <NA>
## 47: Sayeret Shaked <NA> <NA> kkl plantings <NA>
## 48: Sayeret Shaked <NA> <NA> loess <NA>
## 49: Kerem Maharal <NA> <NA> <NA> <NA>
## 50: Meron <NA> <NA> <NA> <NA>
## 51: Ramot Naftali <NA> <NA> <NA> <NA>
## 52: Zuriel <NA> <NA> <NA> <NA>
## 53: Eitanim <NA> <NA> <NA> <NA>
## 54: Manara <NA> <NA> <NA> <NA>
## 55: Zuriel <NA> <NA> <NA> <NA>
## 56: Eitanim <NA> <NA> <NA> <NA>
## site settlements dunes habitat agriculture
## no.of.planned.plots no.of.surveyed.plots delta.plots
## 1: 0 3 3
## 2: 0 3 3
## 3: 0 3 3
## 4: 3 2 -1
## 5: 3 2 -1
## 6: 3 4 1
## 7: 3 1 -2
## 8: 3 2 -1
## 9: 3 2 -1
## 10: 3 4 1
## 11: 3 1 -2
## 12: 3 2 -1
## 13: 3 2 -1
## 14: 3 2 -1
## 15: 3 2 -1
## 16: 3 2 -1
## 17: 3 1 -2
## 18: 3 2 -1
## 19: 3 2 -1
## 20: 3 6 3
## 21: 3 5 2
## 22: 3 1 -2
## 23: 3 2 -1
## 24: 3 2 -1
## 25: 3 2 -1
## 26: 3 2 -1
## 27: 3 4 1
## 28: 3 4 1
## 29: 3 1 -2
## 30: 3 1 -2
## 31: 3 2 -1
## 32: 3 2 -1
## 33: 3 1 -2
## 34: 3 1 -2
## 35: 3 2 -1
## 36: 3 2 -1
## 37: 3 2 -1
## 38: 3 1 -2
## 39: 3 2 -1
## 40: 3 1 -2
## 41: 3 1 -2
## 42: 3 2 -1
## 43: 3 1 -2
## 44: 3 1 -2
## 45: 3 2 -1
## 46: 3 2 -1
## 47: 3 2 -1
## 48: 3 2 -1
## 49: 3 2 -1
## 50: 3 1 -2
## 51: 3 2 -1
## 52: 3 2 -1
## 53: 3 2 -1
## 54: 3 2 -1
## 55: 3 1 -2
## 56: 3 1 -2
## no.of.planned.plots no.of.surveyed.plots delta.plots
write_excel_csv(missing.excessive.plots, 'Analysis/Missing or excessive reptile plots.csv')
# Add plots with zero observations as per Boaz Shacham's e-mail 7.12.2023:
# I need to fill in all the missing plots and find out whether they were surveyed with no observations (zero observations) or not surveyed in the first place
zero.obs <- as.data.table(read_excel('Analysis/Missing reptile plots - Boaz comments.xlsx', sheet = 'zero observations'))
str(zero.obs)
## Classes 'data.table' and 'data.frame': 67 obs. of 14 variables:
## $ campaign : chr "T0" "T0" "T0" "T0" ...
## $ unit : chr "Loess Covered Areas in the Northern Negev" "Loess Covered Areas in the Northern Negev" "Loess Covered Areas in the Northern Negev" "Loess Covered Areas in the Northern Negev" ...
## $ subunit : chr NA NA NA NA ...
## $ site : chr "Eshel Hanasi" "Mishmar Hanegev" "Sayeret Shaked" "Sayeret Shaked" ...
## $ point_name : chr "Eshsel HaNasai agri 2" "Mishmar Hanegev kkl 2" "Sayeret Shaked kkl 3" "Sayeret Shaked kkl 4" ...
## $ latitude : num NA NA NA NA NA ...
## $ longitude : num NA NA NA NA NA ...
## $ dunes : logi NA NA NA NA NA NA ...
## $ habitat : chr "bedouin agriculture" "kkl plantings" "kkl plantings" "kkl plantings" ...
## $ settlements : chr NA NA NA NA ...
## $ count_individuals: num 0 0 0 0 0 0 0 0 0 0 ...
## $ Date : POSIXct, format: "2014-06-16" "2014-07-01" ...
## $ ITime : POSIXct, format: "1899-12-31 14:50:00" "1899-12-31 12:05:00" ...
## $ Comments : chr "No coordinates were recorded" "No coordinates were recorded" "In the records, the plot is called Park Hazerim Netiot and not Sayeret Shaked but this is the same area" "In the records, the plot is called Park Hazerim Netiot and not Sayeret Shaked but this is the same area" ...
## - attr(*, ".internal.selfref")=<externalptr>
zero.obs[!is.na(ITime), .(ITime, as.ITime = as.ITime(as.character(ITime)))] # "as.character" is necessary for a successful conversion
## ITime as.ITime
## 1: 1899-12-31 14:50:00 14:50:00
## 2: 1899-12-31 12:05:00 12:05:00
## 3: 1899-12-31 12:30:00 12:30:00
## 4: 1899-12-31 11:15:00 11:15:00
## 5: 1899-12-31 10:00:00 10:00:00
## 6: 1899-12-31 12:13:00 12:13:00
## 7: 1899-12-31 10:02:00 10:02:00
## 8: 1899-12-31 18:00:00 18:00:00
## 9: 1899-12-31 16:56:00 16:56:00
## 10: 1899-12-31 10:17:00 10:17:00
## 11: 1899-12-31 16:35:00 16:35:00
## 12: 1899-12-31 14:49:00 14:49:00
## 13: 1899-12-31 09:42:00 09:42:00
## 14: 1899-12-31 13:48:00 13:48:00
## 15: 1899-12-31 07:00:00 07:00:00
## 16: 1899-12-31 09:45:00 09:45:00
## 17: 1899-12-31 15:00:00 15:00:00
## 18: 1899-12-31 17:15:00 17:15:00
## 19: 1899-12-31 11:20:00 11:20:00
## 20: 1899-12-31 09:03:00 09:03:00
## 21: 1899-12-31 14:30:00 14:30:00
## 22: 1899-12-31 12:04:00 12:04:00
## 23: 1899-12-31 11:31:00 11:31:00
## 24: 1899-12-31 15:17:00 15:17:00
## 25: 1899-12-31 14:40:00 14:40:00
## 26: 1899-12-31 16:08:00 16:08:00
## 27: 1899-12-31 14:23:00 14:23:00
## 28: 1899-12-31 12:46:00 12:46:00
## 29: 1899-12-31 13:50:00 13:50:00
## 30: 1899-12-31 11:07:00 11:07:00
## 31: 1899-12-31 10:33:00 10:33:00
## 32: 1899-12-31 15:26:00 15:26:00
## 33: 1899-12-31 10:56:00 10:56:00
## 34: 1899-12-31 10:21:00 10:21:00
## 35: 1899-12-31 14:50:00 14:50:00
## 36: 1899-12-31 15:18:00 15:18:00
## 37: 1899-12-31 10:26:00 10:26:00
## 38: 1899-12-31 10:30:00 10:30:00
## 39: 1899-12-31 14:58:00 14:58:00
## 40: 1899-12-31 15:35:00 15:35:00
## 41: 1899-12-31 14:44:00 14:44:00
## 42: 1899-12-31 14:19:00 14:19:00
## 43: 1899-12-31 10:25:00 10:25:00
## 44: 1899-12-31 09:00:00 09:00:00
## 45: 1899-12-31 16:51:00 16:51:00
## 46: 1899-12-31 17:44:00 17:44:00
## 47: 1899-12-31 18:15:00 18:15:00
## 48: 1899-12-31 15:10:00 15:10:00
## 49: 1899-12-31 18:19:00 18:19:00
## 50: 1899-12-31 17:01:00 17:01:00
## 51: 1899-12-31 09:45:00 09:45:00
## 52: 1899-12-31 11:20:00 11:20:00
## 53: 1899-12-31 10:53:00 10:53:00
## 54: 1899-12-31 11:50:00 11:50:00
## 55: 1899-12-31 10:45:00 10:45:00
## 56: 1899-12-31 11:58:00 11:58:00
## 57: 1899-12-31 14:40:00 14:40:00
## 58: 1899-12-31 09:42:00 09:42:00
## 59: 1899-12-31 11:50:00 11:50:00
## 60: 1899-12-31 13:44:00 13:44:00
## 61: 1899-12-31 15:25:00 15:25:00
## 62: 1899-12-31 13:15:00 13:15:00
## 63: 1899-12-31 13:40:00 13:40:00
## 64: 1899-12-31 14:15:00 14:15:00
## 65: 1899-12-31 13:04:00 13:04:00
## 66: 1899-12-31 14:25:00 14:25:00
## 67: 1899-12-31 13:45:00 13:45:00
## ITime as.ITime
zero.obs[, ':=' (Date = as.Date(Date), ITime = as.ITime(as.character(ITime)), start_Time = as.ITime(as.character(ITime)))]
data.table(reptiles_col = names(reptiles), is.in.zero.obs = names(reptiles) %in% names(zero.obs)) # Find columns in the reptiles data.table that do not occour in the zero.obs data.table
## reptiles_col is.in.zero.obs
## 1: site TRUE
## 2: point_name TRUE
## 3: campaign TRUE
## 4: year FALSE
## 5: unit TRUE
## 6: subunit TRUE
## 7: settlements TRUE
## 8: agriculture FALSE
## 9: habitat TRUE
## 10: dunes TRUE
## 11: observations_id FALSE
## 12: latitude TRUE
## 13: longitude TRUE
## 14: date FALSE
## 15: time FALSE
## 16: date_end FALSE
## 17: time_end FALSE
## 18: activity FALSE
## 19: orientation FALSE
## 20: type FALSE
## 21: body FALSE
## 22: tail FALSE
## 23: tail_type FALSE
## 24: SciName FALSE
## 25: stones_flipped FALSE
## 26: weather FALSE
## 27: temp_shade FALSE
## 28: temp_sun FALSE
## 29: site_description FALSE
## 30: obs_snout_len FALSE
## 31: obs_tail_len FALSE
## 32: obs_regentail_len FALSE
## 33: material FALSE
## 34: obs_notes FALSE
## 35: disturbance FALSE
## 36: sv FALSE
## 37: t FALSE
## 38: regen_t FALSE
## 39: substrate FALSE
## 40: survey_protocol FALSE
## 41: count_individuals TRUE
## 42: weather_desc FALSE
## 43: wind FALSE
## 44: sex_new FALSE
## 45: age FALSE
## 46: observation_type FALSE
## 47: Column FALSE
## 48: mean.lat FALSE
## 49: mean.lon FALSE
## 50: conc_lat_lon FALSE
## 51: Date TRUE
## 52: ITime TRUE
## 53: start_Time TRUE
## 54: Date.time FALSE
## reptiles_col is.in.zero.obs
zero.obs[, ':=' (year = year(Date))]
data.table(reptiles_col = names(reptiles), is.in.zero.obs = names(reptiles) %in% names(zero.obs)) # Find columns in the reptiles data.table that do not occour in the zero.obs data.table
## reptiles_col is.in.zero.obs
## 1: site TRUE
## 2: point_name TRUE
## 3: campaign TRUE
## 4: year TRUE
## 5: unit TRUE
## 6: subunit TRUE
## 7: settlements TRUE
## 8: agriculture FALSE
## 9: habitat TRUE
## 10: dunes TRUE
## 11: observations_id FALSE
## 12: latitude TRUE
## 13: longitude TRUE
## 14: date FALSE
## 15: time FALSE
## 16: date_end FALSE
## 17: time_end FALSE
## 18: activity FALSE
## 19: orientation FALSE
## 20: type FALSE
## 21: body FALSE
## 22: tail FALSE
## 23: tail_type FALSE
## 24: SciName FALSE
## 25: stones_flipped FALSE
## 26: weather FALSE
## 27: temp_shade FALSE
## 28: temp_sun FALSE
## 29: site_description FALSE
## 30: obs_snout_len FALSE
## 31: obs_tail_len FALSE
## 32: obs_regentail_len FALSE
## 33: material FALSE
## 34: obs_notes FALSE
## 35: disturbance FALSE
## 36: sv FALSE
## 37: t FALSE
## 38: regen_t FALSE
## 39: substrate FALSE
## 40: survey_protocol FALSE
## 41: count_individuals TRUE
## 42: weather_desc FALSE
## 43: wind FALSE
## 44: sex_new FALSE
## 45: age FALSE
## 46: observation_type FALSE
## 47: Column FALSE
## 48: mean.lat FALSE
## 49: mean.lon FALSE
## 50: conc_lat_lon FALSE
## 51: Date TRUE
## 52: ITime TRUE
## 53: start_Time TRUE
## 54: Date.time FALSE
## reptiles_col is.in.zero.obs
setorder(reptiles, unit, year, campaign, settlements, agriculture, dunes, site, Date)
bla <- rbind(reptiles, zero.obs, fill = T) # add missing zero observations
# Coastal Plain Sands, T0 (2014) - only 3 sites instead of 4 (and 27 plots instead of 36)
reptiles[unit == 'Coastal Plain Sands' & campaign == 'T0', .(plots = unique(point_name)), keyby = .(site, dunes, settlements)] # Caesarea is missing
## site dunes settlements plots
## 1: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 1
## 2: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 2
## 3: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 3
## 4: Ashdod semi-shifting Near Ashdod Near semi-shifting 1
## 5: Ashdod semi-shifting Near Ashdod Near semi-shifting 2
## 6: Ashdod semi-shifting Near Ashdod Near semi-shifting 3
## 7: Ashdod shifting Far Ashdod Far shifting 1
## 8: Ashdod shifting Far Ashdod Far shifting 2
## 9: Ashdod shifting Far Ashdod Far shifting 3
## 10: Ashkelon semi-shifting Far Ashkelon Far semi-shifting 1
## 11: Ashkelon semi-shifting Far Ashkelon Far semi-shifting 3
## 12: Ashkelon semi-shifting Far Ashkelon Far semi-shifting 2
## 13: Ashkelon semi-shifting Near Ashkelon Near semi-shifting 2
## 14: Ashkelon semi-shifting Near Ashkelon Near semi-shifting 3
## 15: Ashkelon semi-shifting Near Ashkelon Near semi-shifting 1
## 16: Ashkelon shifting Far Ashkelon Far shifting 2
## 17: Ashkelon shifting Far Ashkelon Far shifting 1
## 18: Ashkelon shifting Far Ashkelon Far shifting 3
## 19: Netiv Haasara semi-shifting Far Netiv Haasara Far semi-shifting 1
## 20: Netiv Haasara semi-shifting Far Netiv Haasara Far semi-shifting 2
## 21: Netiv Haasara semi-shifting Far Netiv Haasara Far semi-shifting 3
## 22: Netiv Haasara semi-shifting Near Netiv Haasara Near semi-shifting 1
## 23: Netiv Haasara semi-shifting Near Netiv Haasara Near semi-shifting 2
## 24: Netiv Haasara semi-shifting Near Netiv Haasara Near semi-shifting 3
## 25: Netiv Haasara shifting Far Netiv Haasara Far shifting 1
## 26: Netiv Haasara shifting Far Netiv Haasara Far shifting 2
## 27: Netiv Haasara shifting Far Netiv Haasara Far shifting 3
## site dunes settlements plots
bla[unit == 'Coastal Plain Sands' & campaign == 'T0', .(plots = unique(point_name)), keyby = .(site, dunes, settlements)] # Caesarea is missing
## site dunes settlements plots
## 1: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 1
## 2: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 2
## 3: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 3
## 4: Ashdod semi-shifting Near Ashdod Near semi-shifting 1
## 5: Ashdod semi-shifting Near Ashdod Near semi-shifting 2
## 6: Ashdod semi-shifting Near Ashdod Near semi-shifting 3
## 7: Ashdod shifting Far Ashdod Far shifting 1
## 8: Ashdod shifting Far Ashdod Far shifting 2
## 9: Ashdod shifting Far Ashdod Far shifting 3
## 10: Ashkelon semi-shifting Far Ashkelon Far semi-shifting 1
## 11: Ashkelon semi-shifting Far Ashkelon Far semi-shifting 3
## 12: Ashkelon semi-shifting Far Ashkelon Far semi-shifting 2
## 13: Ashkelon semi-shifting Near Ashkelon Near semi-shifting 2
## 14: Ashkelon semi-shifting Near Ashkelon Near semi-shifting 3
## 15: Ashkelon semi-shifting Near Ashkelon Near semi-shifting 1
## 16: Ashkelon shifting Far Ashkelon Far shifting 2
## 17: Ashkelon shifting Far Ashkelon Far shifting 1
## 18: Ashkelon shifting Far Ashkelon Far shifting 3
## 19: Netiv Haasara semi-shifting Far Netiv Haasara Far semi-shifting 1
## 20: Netiv Haasara semi-shifting Far Netiv Haasara Far semi-shifting 2
## 21: Netiv Haasara semi-shifting Far Netiv Haasara Far semi-shifting 3
## 22: Netiv Haasara semi-shifting Near Netiv Haasara Near semi-shifting 1
## 23: Netiv Haasara semi-shifting Near Netiv Haasara Near semi-shifting 2
## 24: Netiv Haasara semi-shifting Near Netiv Haasara Near semi-shifting 3
## 25: Netiv Haasara shifting Far Netiv Haasara Far shifting 1
## 26: Netiv Haasara shifting Far Netiv Haasara Far shifting 2
## 27: Netiv Haasara shifting Far Netiv Haasara Far shifting 3
## site dunes settlements plots
# Coastal Plain Sands, T3 (2019) - only 35 sites instead of 36; no skipped surveys reported in the summary so we assume no reptiles were found
reptiles[unit == 'Coastal Plain Sands' & campaign == 'T3', .(plots = unique(point_name)), keyby = .(site, dunes, settlements)]
## site dunes settlements plots
## 1: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 1
## 2: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 2
## 3: Ashdod semi-shifting Far Ashdod Far Semi-Shifting 3
## 4: Ashdod semi-shifting Near Ashdod Near Semi-Shifting 1
## 5: Ashdod semi-shifting Near Ashdod Near Semi-Shifting 2
## 6: Ashdod semi-shifting Near Ashdod Near Semi-Shifting 3
## 7: Ashdod shifting Far Ashdod Far Shifting 1
## 8: Ashdod shifting Far Ashdod Far Shifting 2
## 9: Ashdod shifting Far Ashdod Far Shifting 3
## 10: Ashkelon semi-shifting Far Ashkelon Far Semi-Shifting 1
## 11: Ashkelon semi-shifting Far Ashkelon Far Semi-Shifting 2
## 12: Ashkelon semi-shifting Far Ashkelon Far Semi-Shifting 3
## 13: Ashkelon semi-shifting Near Ashkelon Near Semi-Shifting 1
## 14: Ashkelon semi-shifting Near Ashkelon Near Semi-Shifting 2
## 15: Ashkelon semi-shifting Near Ashkelon Near Semi-Shifting 3
## 16: Ashkelon shifting Far Ashkelon Far Shifting 1
## 17: Ashkelon shifting Far Ashkelon Far Shifting 2
## 18: Ashkelon shifting Far Ashkelon Far Shifting 3
## 19: Caesarea semi-shifting Far Caesarea Far Semi-Shifting 1
## 20: Caesarea semi-shifting Far Caesarea Far Semi-Shifting 2
## 21: Caesarea semi-shifting Far Caesarea Far Semi-Shifting 3
## 22: Caesarea semi-shifting Near Caesarea Near Semi-Shifting 1
## 23: Caesarea semi-shifting Near Caesarea Near Semi-Shifting 2
## 24: Caesarea shifting Far Caesarea Far Shifting 1
## 25: Caesarea shifting Far Caesarea Far Shifting 2
## 26: Caesarea shifting Far Caesarea Far Shifting 3
## 27: Zikim semi-shifting Far Zikim Far Semi-Shifting 1
## 28: Zikim semi-shifting Far Zikim Far Semi-Shifting 2
## 29: Zikim semi-shifting Far Zikim Far Semi-Shifting 3
## 30: Zikim semi-shifting Near Zikim Near Semi-Shifting 1
## 31: Zikim semi-shifting Near Zikim Near Semi-Shifting 2
## 32: Zikim semi-shifting Near Zikim Near Semi-Shifting 3
## 33: Zikim shifting Far Zikim Far Shifting 1
## 34: Zikim shifting Far Zikim Far Shifting 2
## 35: Zikim shifting Far Zikim Far Shifting 3
## site dunes settlements plots
# Caesarea is missing one Near semi-shifting plot in T0, but it does not appear in the Fulcrum app as well
# reptiles <- rbind(reptiles, cbind(data.table(unit = 'Coastal Plain Sands', campaign = 'T3', year = 2019, site = 'Caesarea',
# dunes = 'semi-shifting', settlements = 'Near', SciName = NA, count_individuals = 0,
# point_name = 'Caesarea semi-shifting Near - missing plot',
# point_name = 'Caesarea semi-shifting Near - missing plot')), fill = T)
# Loess, T0 (2014) - 24 plots instead of 30
reptiles[unit == 'Loess Covered Areas in the Northern Negev' & campaign == 'T0', .(plots = unique(point_name)), keyby = .(site, habitat)] # Caesarea is missing
## site habitat
## 1: Eshel Hanasi bedouin agriculture
## 2: Eshel Hanasi bedouin agriculture
## 3: Givot Bar bedouin agriculture
## 4: Givot Bar bedouin agriculture
## 5: Givot Bar bedouin agriculture
## 6: Mishmar Hanegev bedouin agriculture
## 7: Mishmar Hanegev bedouin agriculture
## 8: Mishmar Hanegev bedouin agriculture
## 9: Mishmar Hanegev kkl plantings
## 10: Mishmar Hanegev kkl plantings
## 11: Nahal Ashan kkl plantings
## 12: Nahal Ashan kkl plantings
## 13: Nahal Ashan kkl plantings
## 14: Nahal Ashan kkl plantings
## 15: Nahal Ashan loess
## 16: Nahal Ashan loess
## 17: Nahal Ashan loess
## 18: Park Loess loess
## 19: Park Loess loess
## 20: Park Loess loess
## 21: Sayeret Shaked kkl plantings
## 22: Sayeret Shaked loess
## 23: Sayeret Shaked loess
## 24: Sayeret Shaked loess
## site habitat
## plots
## 1: Eshel Hanasi bedouin agriculture 31.33814194_34.71648947
## 2: Eshel Hanasi bedouin agriculture 31.34189216_34.7090606
## 3: Givot Bar bedouin agriculture 31.36034694_34.75049867
## 4: Givot Bar bedouin agriculture 31.36423692_34.75671353
## 5: Givot Bar bedouin agriculture 31.37352221_34.77122583
## 6: Mishmar Hanegev bedouin agriculture 31.35953705_34.74353936
## 7: Mishmar Hanegev bedouin agriculture 31.36963753_34.74636994
## 8: Mishmar Hanegev bedouin agriculture 31.37129176_34.73660277
## 9: Mishmar Hanegev kkl plantings 31.36351136_34.73422216
## 10: Mishmar Hanegev kkl plantings 31.36493851_34.72983363
## 11: Nahal Ashan KKL Plantings 2
## 12: Nahal Ashan kkl plantings 31.28265003_34.74862372
## 13: Nahal Ashan kkl plantings 31.28684679_34.74364408
## 14: Nahal Ashan kkl plantings 31.29349178_34.74750308
## 15: Nahal Ashan loess 31.28245503_34.75764806
## 16: Nahal Ashan loess 31.29271253_34.76700752
## 17: Nahal Ashan loess 31.29436508_34.77658303
## 18: Park Loess loess 31.21706343_34.57620702
## 19: Park Loess loess 31.22728013_34.60140018
## 20: Park Loess loess 31.24477105_34.60143498
## 21: Sayeret Shaked kkl plantings 31.27594968_34.66259602
## 22: Sayeret Shaked Sayeret Shaked Loess 2
## 23: Sayeret Shaked loess 31.27294696_34.69498356
## 24: Sayeret Shaked loess 31.28294811_34.68076577
## plots
bla[unit == 'Loess Covered Areas in the Northern Negev' & campaign == 'T0', .(plots = unique(point_name)), keyby = .(site, habitat, Date)] # now 29 plots
## site habitat Date
## 1: Eshel Hanasi bedouin agriculture 2014-06-16
## 2: Eshel Hanasi bedouin agriculture 2014-06-16
## 3: Eshel Hanasi bedouin agriculture 2014-06-16
## 4: Givot Bar bedouin agriculture 2014-07-01
## 5: Givot Bar bedouin agriculture 2014-07-01
## 6: Givot Bar bedouin agriculture 2014-07-01
## 7: Mishmar Hanegev bedouin agriculture 2014-07-01
## 8: Mishmar Hanegev bedouin agriculture 2014-07-01
## 9: Mishmar Hanegev bedouin agriculture 2014-07-01
## 10: Mishmar Hanegev kkl plantings 2014-07-01
## 11: Mishmar Hanegev kkl plantings 2014-07-01
## 12: Mishmar Hanegev kkl plantings 2014-07-01
## 13: Nahal Ashan kkl plantings 2014-06-23
## 14: Nahal Ashan kkl plantings 2014-06-23
## 15: Nahal Ashan kkl plantings 2014-06-23
## 16: Nahal Ashan kkl plantings 2014-06-23
## 17: Nahal Ashan loess 2014-06-23
## 18: Nahal Ashan loess 2014-06-23
## 19: Nahal Ashan loess 2014-06-23
## 20: Park Loess loess 2014-07-01
## 21: Park Loess loess 2014-07-01
## 22: Park Loess loess 2014-07-01
## 23: Sayeret Shaked kkl plantings 2014-06-16
## 24: Sayeret Shaked kkl plantings 2014-06-16
## 25: Sayeret Shaked kkl plantings 2014-06-16
## 26: Sayeret Shaked loess 2014-06-16
## 27: Sayeret Shaked loess 2014-06-16
## 28: Sayeret Shaked loess 2014-06-16
## 29: Sayeret Shaked loess 2014-06-16
## site habitat Date
## plots
## 1: Eshel Hanasi bedouin agriculture 31.33814194_34.71648947
## 2: Eshel Hanasi bedouin agriculture 31.34189216_34.7090606
## 3: Eshsel HaNasai agri 2
## 4: Givot Bar bedouin agriculture 31.36034694_34.75049867
## 5: Givot Bar bedouin agriculture 31.36423692_34.75671353
## 6: Givot Bar bedouin agriculture 31.37352221_34.77122583
## 7: Mishmar Hanegev bedouin agriculture 31.35953705_34.74353936
## 8: Mishmar Hanegev bedouin agriculture 31.36963753_34.74636994
## 9: Mishmar Hanegev bedouin agriculture 31.37129176_34.73660277
## 10: Mishmar Hanegev kkl plantings 31.36351136_34.73422216
## 11: Mishmar Hanegev kkl plantings 31.36493851_34.72983363
## 12: Mishmar Hanegev kkl 2
## 13: Nahal Ashan KKL Plantings 2
## 14: Nahal Ashan kkl plantings 31.28265003_34.74862372
## 15: Nahal Ashan kkl plantings 31.28684679_34.74364408
## 16: Nahal Ashan kkl plantings 31.29349178_34.74750308
## 17: Nahal Ashan loess 31.28245503_34.75764806
## 18: Nahal Ashan loess 31.29271253_34.76700752
## 19: Nahal Ashan loess 31.29436508_34.77658303
## 20: Park Loess loess 31.21706343_34.57620702
## 21: Park Loess loess 31.22728013_34.60140018
## 22: Park Loess loess 31.24477105_34.60143498
## 23: Sayeret Shaked kkl plantings 31.27594968_34.66259602
## 24: Sayeret Shaked kkl 3
## 25: Sayeret Shaked kkl 4
## 26: Sayeret Shaked Sayeret Shaked Loess 2
## 27: Sayeret Shaked loess 31.27294696_34.69498356
## 28: Sayeret Shaked loess 31.28294811_34.68076577
## 29: Sayeret Shaked loess 5
## plots
# Loess, T1 (2015) - 28 plots instead of 30
reptiles[unit == 'Loess Covered Areas in the Northern Negev' & campaign == 'T1', .(plots = unique(point_name)), keyby = .(site, habitat)]
## site habitat
## 1: Eshel Hanasi bedouin agriculture
## 2: Eshel Hanasi bedouin agriculture
## 3: Eshel Hanasi bedouin agriculture
## 4: Givot Bar bedouin agriculture
## 5: Givot Bar bedouin agriculture
## 6: Givot Bar bedouin agriculture
## 7: Goral bedouin agriculture
## 8: Mishmar Hanegev bedouin agriculture
## 9: Mishmar Hanegev bedouin agriculture
## 10: Mishmar Hanegev bedouin agriculture
## 11: Mishmar Hanegev kkl plantings
## 12: Mishmar Hanegev kkl plantings
## 13: Mishmar Hanegev kkl plantings
## 14: Nahal Ashan kkl plantings
## 15: Nahal Ashan kkl plantings
## 16: Nahal Ashan kkl plantings
## 17: Nahal Ashan loess
## 18: Nahal Ashan loess
## 19: Nahal Ashan loess
## 20: Park Loess loess
## 21: Park Loess loess
## 22: Park Loess loess
## 23: Sayeret Shaked kkl plantings
## 24: Sayeret Shaked kkl plantings
## 25: Sayeret Shaked kkl plantings
## 26: Sayeret Shaked loess
## 27: Sayeret Shaked loess
## 28: Sayeret Shaked loess
## site habitat
## plots
## 1: Eshel Hanasi bedouin agriculture 31.33814225_34.71649764
## 2: Eshel Hanasi bedouin agriculture 31.35262598_34.70604572
## 3: Eshel Hanasi bedouin agriculture 31.34189242_34.70906885
## 4: Givot Bar bedouin agriculture 31.36034701_34.75050648
## 5: Givot Bar bedouin agriculture 31.36423695_34.75672127
## 6: Givot Bar bedouin agriculture 31.37352214_34.77123341
## 7: Goral bedouin agriculture 31.30989169_34.80028378
## 8: Mishmar Hanegev bedouin agriculture 31.35953712_34.74354725
## 9: Mishmar Hanegev bedouin agriculture 31.3696375_34.74637779
## 10: Mishmar Hanegev bedouin agriculture 31.37129171_34.73661073
## 11: Mishmar Hanegev kkl plantings 31.36351139_34.73423014
## 12: Mishmar Hanegev kkl plantings 31.36493852_34.72984166
## 13: Mishmar Hanegev kkl plantings 31.36761346_34.73241737
## 14: Nahal Ashan kkl plantings 31.28265093_34.74863154
## 15: Nahal Ashan kkl plantings 31.28684766_34.74365196
## 16: Nahal Ashan kkl plantings 31.29349257_34.74751092
## 17: Nahal Ashan loess 31.28245593_34.75765578
## 18: Nahal Ashan loess 31.29271333_34.76701515
## 19: Nahal Ashan loess 31.29436586_34.77659055
## 20: Park Loess loess 31.21706506_34.57621669
## 21: Park Loess loess 31.22728165_34.60140959
## 22: Park Loess loess 31.24477238_34.60144439
## 23: Sayeret Shaked kkl plantings 31.26322827_34.65977867
## 24: Sayeret Shaked kkl plantings 31.26959058_34.66913156
## 25: Sayeret Shaked kkl plantings 31.27595066_34.66260477
## 26: Sayeret Shaked loess 31.27294798_34.69499196
## 27: Sayeret Shaked loess 31.27486693_34.68890758
## 28: Sayeret Shaked loess 31.28294902_34.68077432
## plots
bla[unit == 'Loess Covered Areas in the Northern Negev' & campaign == 'T1', .(plots = unique(point_name)), keyby = .(site, habitat)] # now 30 plots
## site habitat
## 1: Eshel Hanasi bedouin agriculture
## 2: Eshel Hanasi bedouin agriculture
## 3: Eshel Hanasi bedouin agriculture
## 4: Givot Bar bedouin agriculture
## 5: Givot Bar bedouin agriculture
## 6: Givot Bar bedouin agriculture
## 7: Goral bedouin agriculture
## 8: Goral bedouin agriculture
## 9: Goral bedouin agriculture
## 10: Mishmar Hanegev bedouin agriculture
## 11: Mishmar Hanegev bedouin agriculture
## 12: Mishmar Hanegev bedouin agriculture
## 13: Mishmar Hanegev kkl plantings
## 14: Mishmar Hanegev kkl plantings
## 15: Mishmar Hanegev kkl plantings
## 16: Nahal Ashan kkl plantings
## 17: Nahal Ashan kkl plantings
## 18: Nahal Ashan kkl plantings
## 19: Nahal Ashan loess
## 20: Nahal Ashan loess
## 21: Nahal Ashan loess
## 22: Park Loess loess
## 23: Park Loess loess
## 24: Park Loess loess
## 25: Sayeret Shaked kkl plantings
## 26: Sayeret Shaked kkl plantings
## 27: Sayeret Shaked kkl plantings
## 28: Sayeret Shaked loess
## 29: Sayeret Shaked loess
## 30: Sayeret Shaked loess
## site habitat
## plots
## 1: Eshel Hanasi bedouin agriculture 31.33814225_34.71649764
## 2: Eshel Hanasi bedouin agriculture 31.35262598_34.70604572
## 3: Eshel Hanasi bedouin agriculture 31.34189242_34.70906885
## 4: Givot Bar bedouin agriculture 31.36034701_34.75050648
## 5: Givot Bar bedouin agriculture 31.36423695_34.75672127
## 6: Givot Bar bedouin agriculture 31.37352214_34.77123341
## 7: Goral bedouin agriculture 31.30989169_34.80028378
## 8: Goral Bedouin Agriculture 3
## 9: Goral Bedouin Agriculture 1
## 10: Mishmar Hanegev bedouin agriculture 31.35953712_34.74354725
## 11: Mishmar Hanegev bedouin agriculture 31.3696375_34.74637779
## 12: Mishmar Hanegev bedouin agriculture 31.37129171_34.73661073
## 13: Mishmar Hanegev kkl plantings 31.36351139_34.73423014
## 14: Mishmar Hanegev kkl plantings 31.36493852_34.72984166
## 15: Mishmar Hanegev kkl plantings 31.36761346_34.73241737
## 16: Nahal Ashan kkl plantings 31.28265093_34.74863154
## 17: Nahal Ashan kkl plantings 31.28684766_34.74365196
## 18: Nahal Ashan kkl plantings 31.29349257_34.74751092
## 19: Nahal Ashan loess 31.28245593_34.75765578
## 20: Nahal Ashan loess 31.29271333_34.76701515
## 21: Nahal Ashan loess 31.29436586_34.77659055
## 22: Park Loess loess 31.21706506_34.57621669
## 23: Park Loess loess 31.22728165_34.60140959
## 24: Park Loess loess 31.24477238_34.60144439
## 25: Sayeret Shaked kkl plantings 31.26322827_34.65977867
## 26: Sayeret Shaked kkl plantings 31.26959058_34.66913156
## 27: Sayeret Shaked kkl plantings 31.27595066_34.66260477
## 28: Sayeret Shaked loess 31.27294798_34.69499196
## 29: Sayeret Shaked loess 31.27486693_34.68890758
## 30: Sayeret Shaked loess 31.28294902_34.68077432
## plots
# Loess, T2 (2017) - 25 plots instead of 30
reptiles[unit == 'Loess Covered Areas in the Northern Negev' & campaign == 'T2', .(plots = unique(point_name)), keyby = .(site, habitat)]
## site habitat plots
## 1: Eshel Hanasi bedouin agriculture Eshel Hanasi Bedouin Agriculture 1
## 2: Givot Bar bedouin agriculture Givot Bar Bedouin Agriculture 2
## 3: Givot Bar bedouin agriculture Givot Bar Bedouin Agriculture 3
## 4: Goral bedouin agriculture Goral Bedouin Agriculture 1
## 5: Goral bedouin agriculture Goral Bedouin Agriculture 2
## 6: Goral bedouin agriculture Goral Bedouin Agriculture 3
## 7: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 3
## 8: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 1
## 9: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 2
## 10: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 1
## 11: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 2
## 12: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 3
## 13: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 1
## 14: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 2
## 15: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 3
## 16: Nahal Ashan loess Nahal Ashan Loess 1
## 17: Nahal Ashan loess Nahal Ashan Loess 3
## 18: Park Loess loess Park Loess Loess 1
## 19: Park Loess loess Park Loess Loess 3
## 20: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 1
## 21: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 3
## 22: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 4
## 23: Sayeret Shaked loess Sayeret Shaked Loess 1
## 24: Sayeret Shaked loess Sayeret Shaked Loess 5
## 25: Sayeret Shaked loess Sayeret Shaked Sayeret Shaked Loess 2
## site habitat plots
bla[unit == 'Loess Covered Areas in the Northern Negev' & campaign == 'T2', .(plots = unique(point_name)), keyby = .(site, habitat)] # now 28 plots
## site habitat plots
## 1: Eshel Hanasi bedouin agriculture Eshel Hanasi Bedouin Agriculture 1
## 2: Eshel Hanasi bedouin agriculture Eshsel HaNasai agri 3
## 3: Givot Bar bedouin agriculture Givot Bar Bedouin Agriculture 2
## 4: Givot Bar bedouin agriculture Givot Bar Bedouin Agriculture 3
## 5: Goral bedouin agriculture Goral Bedouin Agriculture 1
## 6: Goral bedouin agriculture Goral Bedouin Agriculture 2
## 7: Goral bedouin agriculture Goral Bedouin Agriculture 3
## 8: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 3
## 9: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 1
## 10: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 2
## 11: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 1
## 12: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 2
## 13: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 3
## 14: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 1
## 15: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 2
## 16: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 3
## 17: Nahal Ashan loess Nahal Ashan Loess 1
## 18: Nahal Ashan loess Nahal Ashan Loess 3
## 19: Nahal Ashan loess Nahal Ashan Loess 2
## 20: Park Loess loess Park Loess Loess 1
## 21: Park Loess loess Park Loess Loess 3
## 22: Park Loess loess Park Loess Loess 2
## 23: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 1
## 24: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 3
## 25: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 4
## 26: Sayeret Shaked loess Sayeret Shaked Loess 1
## 27: Sayeret Shaked loess Sayeret Shaked Loess 5
## 28: Sayeret Shaked loess Sayeret Shaked Sayeret Shaked Loess 2
## site habitat plots
# Loess, T3 (2019) - 22 plots instead of 30
reptiles[unit == 'Loess Covered Areas in the Northern Negev' & campaign == 'T3', .(plots = unique(point_name)), keyby = .(site, habitat)]
## site habitat plots
## 1: Eshel Hanasi bedouin agriculture Eshel Hanasi Bedouin Agriculture 1
## 2: Givot Bar bedouin agriculture Givot Bar Bedouin Agriculture 1
## 3: Goral bedouin agriculture Goral Bedouin Agriculture 2
## 4: Goral bedouin agriculture Goral Bedouin Agriculture 3
## 5: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 1
## 6: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 2
## 7: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 3
## 8: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 2
## 9: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 3
## 10: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 1
## 11: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 2
## 12: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 3
## 13: Nahal Ashan loess Nahal Ashan Loess 1
## 14: Nahal Ashan loess Nahal Ashan Loess 2
## 15: Nahal Ashan loess Nahal Ashan Loess 3
## 16: Park Loess loess Park Loess Loess 1
## 17: Park Loess loess Park Loess Loess 2
## 18: Park Loess loess Park Loess Loess 3
## 19: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 1
## 20: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 4
## 21: Sayeret Shaked loess Sayeret Shaked Loess 1
## 22: Sayeret Shaked loess Sayeret Shaked Loess 5
## site habitat plots
bla[unit == 'Loess Covered Areas in the Northern Negev' & campaign == 'T3', .(plots = unique(point_name)), keyby = .(site, habitat)] # still 22 plots
## site habitat plots
## 1: Eshel Hanasi bedouin agriculture Eshel Hanasi Bedouin Agriculture 1
## 2: Eshel Hanasi bedouin agriculture Eshsel HaNasai agri 3
## 3: Givot Bar bedouin agriculture Givot Bar Bedouin Agriculture 1
## 4: Goral bedouin agriculture Goral Bedouin Agriculture 2
## 5: Goral bedouin agriculture Goral Bedouin Agriculture 3
## 6: Goral bedouin agriculture Goral Bedouin Agriculture 1
## 7: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 1
## 8: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 2
## 9: Mishmar Hanegev bedouin agriculture Mishmar Hanegev Bedouin Agriculture 3
## 10: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 2
## 11: Mishmar Hanegev kkl plantings Mishmar Hanegev KKL Plantings 3
## 12: Mishmar Hanegev kkl plantings Mishmar Hanegev kkl 1
## 13: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 1
## 14: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 2
## 15: Nahal Ashan kkl plantings Nahal Ashan KKL Plantings 3
## 16: Nahal Ashan loess Nahal Ashan Loess 1
## 17: Nahal Ashan loess Nahal Ashan Loess 2
## 18: Nahal Ashan loess Nahal Ashan Loess 3
## 19: Park Loess loess Park Loess Loess 1
## 20: Park Loess loess Park Loess Loess 2
## 21: Park Loess loess Park Loess Loess 3
## 22: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 1
## 23: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 4
## 24: Sayeret Shaked kkl plantings Sayeret Shaked KKL Plantings 3
## 25: Sayeret Shaked loess Sayeret Shaked Loess 1
## 26: Sayeret Shaked loess Sayeret Shaked Loess 5
## 27: Sayeret Shaked loess Sayeret Shaked Loess 2
## site habitat plots
# Med-desert transition, T0 (2014) - 29 plots instead of 30
reptiles[unit == 'Mediterranean-Desert Transition Zone' & campaign == 'T0', .(plots = unique(point_name)), keyby = .(site, settlements)]
## site settlements plots
## 1: Beit Yatir Far Beit Yatir Far 31.35114151_35.12245726
## 2: Beit Yatir Far Beit Yatir Far 31.35013846_35.11235947
## 3: Beit Yatir Far Beit Yatir Far 31.36048202_35.13023961
## 4: Beit Yatir Near Beit Yatir Near 31.35936566_35.11638381
## 5: Beit Yatir Near Beit Yatir Near 31.3616697_35.10994797
## 6: Beit Yatir Near Beit Yatir Near 31.36983666_35.11023255
## 7: Har Amasa Far Har Amasa Far 31.35044064_35.12192146
## 8: Har Amasa Far Har Amasa Far 31.34690363_35.11116131
## 9: Har Amasa Far Har Amasa Far 31.33245149_35.10733619
## 10: Har Amasa Near Har Amasa Near 31.34235562_35.10285599
## 11: Har Amasa Near Har Amasa Near 31.3435548_35.10418644
## 12: Har Amasa Near Har Amasa Near 31.34493183_35.10377892
## 13: Lahav Far Lahav Far 31.38801501_34.860428
## 14: Lahav Far Lahav Far 31.39560409_34.85918386
## 15: Lahav Near Lahav Near 31.38063841_34.86321922
## 16: Lahav Near Lahav Near 31.38116555_34.87381881
## 17: Lahav Near Lahav Near 31.38184847_34.86639343
## 18: Lehavim Far Lehavim Far 31.3350892_34.83998961
## 19: Lehavim Far Lehavim Far 31.35798817_34.84029091
## 20: Lehavim Near Lehavim Near 1
## 21: Lehavim Near Lehavim Near 31.36815471_34.82319744
## 22: Lehavim Near Lehavim Near 6
## 23: Lehavim Near Lehavim Near 31.3659832_34.82239692
## 24: Mirsham Far Mirsham Far 31.45827683_34.90100711
## 25: Mirsham Far Mirsham Far 31.50077347_34.93924637
## 26: Mirsham Far Mirsham Far 31.5002719_34.92750673
## 27: Mirsham Near Mirsham Near 31.47629966_34.92475669
## 28: Mirsham Near Mirsham Near 31.47977937_34.92723182
## 29: Mirsham Near Mirsham Near 31.48034042_34.92626049
## site settlements plots
bla[unit == 'Mediterranean-Desert Transition Zone' & campaign == 'T0', .(plots = unique(point_name)), keyby = .(site, settlements, Date)] # now 31 plots
## site settlements Date plots
## 1: Beit Yatir Far 2014-04-16 Beit Yatir Far 31.35114151_35.12245726
## 2: Beit Yatir Far 2014-05-27 Beit Yatir Far 31.35013846_35.11235947
## 3: Beit Yatir Far 2014-06-26 Beit Yatir Far 31.36048202_35.13023961
## 4: Beit Yatir Near 2014-04-16 Beit Yatir Near 31.35936566_35.11638381
## 5: Beit Yatir Near 2014-04-16 Beit Yatir Near 31.3616697_35.10994797
## 6: Beit Yatir Near 2014-04-16 Beit Yatir Near 31.36983666_35.11023255
## 7: Har Amasa Far 2014-04-16 Har Amasa Far 31.35044064_35.12192146
## 8: Har Amasa Far 2014-05-27 Har Amasa Far 31.34690363_35.11116131
## 9: Har Amasa Far 2014-06-26 Har Amasa Far 31.33245149_35.10733619
## 10: Har Amasa Near 2014-05-27 Har Amasa Near 31.34235562_35.10285599
## 11: Har Amasa Near 2014-05-27 Har Amasa Near 31.3435548_35.10418644
## 12: Har Amasa Near 2014-05-27 Har Amasa Near 31.34493183_35.10377892
## 13: Lahav Far 2014-05-05 Lahav Far 31.38801501_34.860428
## 14: Lahav Far 2014-05-05 Lahav Far 31.39560409_34.85918386
## 15: Lahav Far 2014-05-05 Lahav Far 3
## 16: Lahav Near 2014-05-05 Lahav Near 31.38063841_34.86321922
## 17: Lahav Near 2014-05-05 Lahav Near 31.38116555_34.87381881
## 18: Lahav Near 2014-05-05 Lahav Near 31.38184847_34.86639343
## 19: Lehavim Far 2014-04-24 Lehavim Far 31.3350892_34.83998961
## 20: Lehavim Far 2014-04-24 Lehavim Far 31.35798817_34.84029091
## 21: Lehavim Far 2014-04-24 Lehavim Far 1
## 22: Lehavim Near 2014-04-24 Lehavim Near 1
## 23: Lehavim Near 2014-04-24 Lehavim Near 31.36815471_34.82319744
## 24: Lehavim Near 2014-04-24 Lehavim Near 6
## 25: Lehavim Near 2014-06-26 Lehavim Near 31.3659832_34.82239692
## 26: Lehavim Near 2014-06-26 Lehavim Near 12
## 27: Mirsham Far 2014-06-10 Mirsham Far 31.45827683_34.90100711
## 28: Mirsham Far 2014-06-10 Mirsham Far 31.50077347_34.93924637
## 29: Mirsham Far 2014-06-26 Mirsham Far 31.5002719_34.92750673
## 30: Mirsham Near 2014-06-10 Mirsham Near 31.47629966_34.92475669
## 31: Mirsham Near 2014-06-10 Mirsham Near 31.47977937_34.92723182
## 32: Mirsham Near 2014-06-10 Mirsham Near 31.48034042_34.92626049
## site settlements Date plots
bla[campaign == 'T0' & site == 'Lehavim', sort(unique(point_name))] # As per Boaz Shacham's e-mail from 1.2.2024, Lehavim Near1 was cancelled because it did not contain enough stones so it should be omitted from the data
## [1] "Lehavim Far 1"
## [2] "Lehavim Far 31.3350892_34.83998961"
## [3] "Lehavim Far 31.35798817_34.84029091"
## [4] "Lehavim Near 1"
## [5] "Lehavim Near 12"
## [6] "Lehavim Near 31.3659832_34.82239692"
## [7] "Lehavim Near 31.36815471_34.82319744"
## [8] "Lehavim Near 6"
bla[point_name == 'Lehavim Near 1'] # only one record from this plot
## site point_name campaign year unit
## 1: Lehavim Lehavim Near 1 T0 2014 Mediterranean-Desert Transition Zone
## subunit settlements agriculture habitat dunes observations_id latitude
## 1: <NA> Near <NA> <NA> <NA> NA
## longitude date time date_end time_end activity orientation type
## 1: NA 24/04/2014 10:50:00 remains on ground
## body tail tail_type SciName stones_flipped weather temp_shade
## 1: NA <NA> <NA> Testudo graeca NA <NA> NA
## temp_sun site_description obs_snout_len obs_tail_len obs_regentail_len
## 1: NA <NA> NA NA NA
## material obs_notes disturbance sv t regen_t substrate survey_protocol
## 1: <NA> <NA> <NA> NA NA NA <NA> scan
## count_individuals weather_desc wind sex_new age observation_type Column
## 1: 1 <NA> <NA> <NA> <NA> indirect <NA>
## mean.lat mean.lon conc_lat_lon Date ITime start_Time
## 1: NA NA NA_NA 2014-04-24 09:50:00 10:50:00
## Date.time Comments
## 1: 2014-04-24 09:50:00 <NA>
bla <- bla[point_name != 'Lehavim Near 1'] # omit it
# There was also an issue with a plot discovered to be an archaeological site in Lehavim Near in 2014 (T0):
reptiles.raw[site == 'Lehavim' & campaign == 'T0' & settlements == 'Near',
.(latitude, longitude, settlements, point_name, date, time, SciName, count_individuals, obs_notes)]
## latitude longitude settlements point_name date time
## 1: 31.36815 34.8232 Near <NA> 24/04/2014 11:57:00
## 2: 31.36815 34.8232 Near <NA> 24/04/2014 12:02:00
## 3: 31.36598 34.8224 Near <NA> 26/06/2014 16:57:00
## 4: NA NA Near Lehavim Near 1 24/04/2014 10:50:00
## 5: NA NA Near Lehavim Near 6 24/04/2014 11:23:00
## SciName count_individuals obs_notes
## 1: Ablepharus rueppellii 1 <NA>
## 2: Ablepharus rueppellii 1 <NA>
## 3: Ophisops elegans 1 <NA>
## 4: Testudo graeca 1 <NA>
## 5: Laudakia vulgaris 1 <NA>
# raw data: 4 Near plots, 2 with coordinates but no names (1 from 24/4/2014 and 1 from 26/6/2014) and 2 with names but no coordinates (both from 24/4/2014 - 2 months earlier)
bla[site == 'Lehavim' & campaign == 'T0', .(conc_lat_lon, point_name, Date, time, SciName, count_individuals)]
## conc_lat_lon point_name Date
## 1: 31.3350892_34.83998961 Lehavim Far 31.3350892_34.83998961 2014-04-24
## 2: 31.3350892_34.83998961 Lehavim Far 31.3350892_34.83998961 2014-04-24
## 3: 31.35798817_34.84029091 Lehavim Far 31.35798817_34.84029091 2014-04-24
## 4: 31.35798817_34.84029091 Lehavim Far 31.35798817_34.84029091 2014-04-24
## 5: 31.35798817_34.84029091 Lehavim Far 31.35798817_34.84029091 2014-04-24
## 6: 31.36815471_34.82319744 Lehavim Near 31.36815471_34.82319744 2014-04-24
## 7: 31.36815471_34.82319744 Lehavim Near 31.36815471_34.82319744 2014-04-24
## 8: NA_NA Lehavim Near 6 2014-04-24
## 9: 31.3659832_34.82239692 Lehavim Near 31.3659832_34.82239692 2014-06-26
## 10: <NA> Lehavim Far 1 2014-04-24
## 11: <NA> Lehavim Near 12 2014-06-26
## time SciName count_individuals
## 1: 14:15:00 Chalcides guentheri 1
## 2: 14:17:00 Chalcides ocellatus 1
## 3: 12:49:00 Heremites vittatus 1
## 4: 12:56:00 Hemidactylus turcicus 1
## 5: 13:05:00 Eumeces schneiderii 1
## 6: 11:57:00 Ablepharus rueppellii 1
## 7: 12:02:00 Ablepharus rueppellii 1
## 8: 11:23:00 Laudakia vulgaris 1
## 9: 16:57:00 Ophisops elegans 1
## 10: <NA> <NA> 0
## 11: <NA> <NA> 0
# According to Boaz Shacham's mail from 31/1/2024, Near 5 was an archaeological site (...and thus should be omitted? Unclear).
# According to the raw data file ('SFAR_2014_06_26c.xlsx'), Near5's observations are from 11:57 and 12:02
bla <- bla[!(site == 'Lehavim' & campaign == 'T0' & time %in% c('11:57:00', '12:02:00'))] # So omit these observations
bla[site == 'Lehavim', .(no.of.campaigns.surveyed = uniqueN(campaign)), keyby = .(point_name, conc_lat_lon, latitude, longitude)] # Lehavim Near 11 has coordinats only in some campaigns
## point_name conc_lat_lon latitude
## 1: Lehavim Far 1 <NA> NA
## 2: Lehavim Far 1 31.33419117_34.82849153 31.33419
## 3: Lehavim Far 2 31.33508953_34.83999645 31.33509
## 4: Lehavim Far 31.33419117_34.82849153 31.33419117_34.82849153 31.33419
## 5: Lehavim Far 31.3350892_34.83998961 31.3350892_34.83998961 31.33509
## 6: Lehavim Far 31.33508953_34.83999645 31.33508953_34.83999645 31.33509
## 7: Lehavim Far 31.35798817_34.84029091 31.35798817_34.84029091 31.35799
## 8: Lehavim Far 31.35798826_34.84029775 31.35798826_34.84029775 31.35799
## 9: Lehavim Far 5 31.35798826_34.84029775 31.35799
## 10: Lehavim Near 11 <NA> 31.36598
## 11: Lehavim Near 11 31.3659832_34.82240395 31.36598
## 12: Lehavim Near 12 <NA> 31.36355
## 13: Lehavim Near 12 31.36355103_34.82061174 31.36355
## 14: Lehavim Near 31.36355103_34.82061174 31.36355103_34.82061174 31.36355
## 15: Lehavim Near 31.3659832_34.82239692 31.3659832_34.82239692 31.36598
## 16: Lehavim Near 31.36815469_34.82320446 31.36815469_34.82320446 31.36815
## 17: Lehavim Near 4 31.36815469_34.82320446 31.36815
## 18: Lehavim Near 6 NA_NA NA
## longitude no.of.campaigns.surveyed
## 1: NA 1
## 2: 34.82849 2
## 3: 34.84000 2
## 4: 34.82849 1
## 5: 34.83999 1
## 6: 34.84000 1
## 7: 34.84029 1
## 8: 34.84030 1
## 9: 34.84030 2
## 10: 34.82240 1
## 11: 34.82240 2
## 12: 34.82061 1
## 13: 34.82061 2
## 14: 34.82061 1
## 15: 34.82240 1
## 16: 34.82320 1
## 17: 34.82320 2
## 18: NA 1
bla[point_name == 'Lehavim Near 11', .(campaign, Date, point_name, ITime, longitude, latitude, conc_lat_lon, SciName, count_individuals)] # conc_lat_lon is missing for T1 (zero count)
## campaign Date point_name ITime longitude latitude
## 1: T2 2018-04-04 Lehavim Near 11 10:35:00 34.8224 31.36598
## 2: T2 2018-04-04 Lehavim Near 11 10:35:00 34.8224 31.36598
## 3: T3 2020-03-24 Lehavim Near 11 12:17:00 34.8224 31.36598
## 4: T1 2016-04-07 Lehavim Near 11 11:20:00 34.8224 31.36598
## conc_lat_lon SciName count_individuals
## 1: 31.3659832_34.82240395 Ophisops elegans 1
## 2: 31.3659832_34.82240395 Chalcides ocellatus 1
## 3: 31.3659832_34.82240395 Heremites vittatus 1
## 4: <NA> <NA> 0
bla[point_name == 'Lehavim Near 11', conc_lat_lon := '31.3659832_34.82240395']
bla[conc_lat_lon == '31.36355103_34.82061174', .(campaign, Date, point_name, ITime, longitude, latitude, conc_lat_lon, SciName, count_individuals)] # conc_lat_lon is missing for T1 (zero count)
## campaign Date point_name ITime longitude
## 1: T1 2016-04-07 Lehavim Near 31.36355103_34.82061174 10:57:00 34.82061
## 2: T2 2018-04-04 Lehavim Near 12 11:10:00 34.82061
## 3: T2 2018-04-04 Lehavim Near 12 11:10:00 34.82061
## 4: T3 2020-03-24 Lehavim Near 12 13:00:00 34.82061
## latitude conc_lat_lon SciName count_individuals
## 1: 31.36355 31.36355103_34.82061174 Eumeces schneiderii 1
## 2: 31.36355 31.36355103_34.82061174 Stellagama stellio 1
## 3: 31.36355 31.36355103_34.82061174 Ophisops elegans 2
## 4: 31.36355 31.36355103_34.82061174 Ophisops elegans 1
# Lehavim Near 31.36355103_34.82061174 is actually Lehavim Near 12
# Med-desert transition, T1 (2016)
reptiles.raw[unit == 'Mediterranean-Desert Transition Zone' & campaign == 'T1', .(plots = unique(point_name)), keyby = .(year, site, settlements)] # raw data has no plot names
## year site settlements plots
## 1: 2016 Beit Yatir Far <NA>
## 2: 2016 Beit Yatir Near <NA>
## 3: 2016 Har Amasa Far <NA>
## 4: 2016 Har Amasa Near <NA>
## 5: 2016 Lahav Far <NA>
## 6: 2016 Lahav Near <NA>
## 7: 2016 Lehavim Far <NA>
## 8: 2016 Lehavim Near <NA>
## 9: 2016 Mirsham Far <NA>
## 10: 2016 Mirsham Near <NA>
reptiles[unit == 'Mediterranean-Desert Transition Zone' & campaign == 'T1', .(plots = unique(point_name)), keyby = .(year, site, settlements)] # so we give them names from nearby plots
## year site settlements plots
## 1: 2016 Beit Yatir Far Beit Yatir Far 31.35114166_35.12246105
## 2: 2016 Beit Yatir Far Beit Yatir Far 31.35013862_35.11236337
## 3: 2016 Beit Yatir Far Beit Yatir Far 31.36048207_35.13024331
## 4: 2016 Beit Yatir Near Beit Yatir Near 31.35936572_35.11638766
## 5: 2016 Beit Yatir Near Beit Yatir Near 31.36253667_35.11037048
## 6: 2016 Beit Yatir Near Beit Yatir Near 31.36983661_35.11023647
## 7: 2016 Har Amasa Far Har Amasa Far 31.33245184_35.10734014
## 8: 2016 Har Amasa Far Har Amasa Far 31.34690383_35.11116522
## 9: 2016 Har Amasa Far Har Amasa Far 31.35044079_35.12192526
## 10: 2016 Har Amasa Near Har Amasa Near 31.34235586_35.10285999
## 11: 2016 Har Amasa Near Har Amasa Near 31.34355503_35.10419043
## 12: 2016 Har Amasa Near Har Amasa Near 31.34493205_35.1037829
## 13: 2016 Lahav Far Lahav Far 31.38801477_34.86043462
## 14: 2016 Lahav Far Lahav Far 31.39560377_34.85919049
## 15: 2016 Lahav Far Lahav Far 31.39574464_34.86749377
## 16: 2016 Lahav Near Lahav Near 31.38063825_34.86322581
## 17: 2016 Lahav Near Lahav Near 31.38116538_34.87382529
## 18: 2016 Lahav Near Lahav Near 31.3818483_34.86639998
## 19: 2016 Lehavim Far Lehavim Far 31.33419117_34.82849153
## 20: 2016 Lehavim Far Lehavim Far 31.33508953_34.83999645
## 21: 2016 Lehavim Far Lehavim Far 31.35798826_34.84029775
## 22: 2016 Lehavim Near Lehavim Near 31.36355103_34.82061174
## 23: 2016 Lehavim Near Lehavim Near 31.36815469_34.82320446
## 24: 2016 Mirsham Far Mirsham Far 31.45827583_34.9010133
## 25: 2016 Mirsham Far Mirsham Far 31.47465474_34.9201405
## 26: 2016 Mirsham Far Mirsham Far 31.50077201_34.93925215
## 27: 2016 Mirsham Near Mirsham Near 31.47977814_34.92723773
## 28: 2016 Mirsham Near Mirsham Near 31.48033918_34.92626641
## year site settlements plots
reptiles[site == 'Mirsham', .(plots = unique(point_name)), keyby = .(conc_lat_lon, year, settlements)] # Note that "Mirsham 81" (which is *Near*) is the same as Mirsham *Far* 31.47465474_34.9201405
## conc_lat_lon year settlements
## 1: 31.45827583_34.9010133 2016 Far
## 2: 31.45827583_34.9010133 2018 Far
## 3: 31.45827583_34.9010133 2020 Far
## 4: 31.45827683_34.90100711 2014 Far
## 5: 31.47465474_34.9201405 2016 Far
## 6: 31.47465474_34.9201405 2018 Near
## 7: 31.47465474_34.9201405 2020 Near
## 8: 31.47629966_34.92475669 2014 Near
## 9: 31.47977814_34.92723773 2016 Near
## 10: 31.47977814_34.92723773 2018 Near
## 11: 31.47977814_34.92723773 2020 Near
## 12: 31.47977937_34.92723182 2014 Near
## 13: 31.48033918_34.92626641 2016 Near
## 14: 31.48033918_34.92626641 2018 Near
## 15: 31.48033918_34.92626641 2020 Near
## 16: 31.48034042_34.92626049 2014 Near
## 17: 31.50027044_34.92751264 2018 Far
## 18: 31.50027044_34.92751264 2020 Far
## 19: 31.5002719_34.92750673 2014 Far
## 20: 31.50077201_34.93925215 2016 Far
## 21: 31.50077201_34.93925215 2018 Far
## 22: 31.50077201_34.93925215 2020 Far
## 23: 31.50077347_34.93924637 2014 Far
## conc_lat_lon year settlements
## plots
## 1: Mirsham Far 31.45827583_34.9010133
## 2: Mirsham Far 12
## 3: Mirsham Far 12
## 4: Mirsham Far 31.45827683_34.90100711
## 5: Mirsham Far 31.47465474_34.9201405
## 6: Mirsham Near 81
## 7: Mirsham Near 81
## 8: Mirsham Near 31.47629966_34.92475669
## 9: Mirsham Near 31.47977814_34.92723773
## 10: Mirsham Near 9
## 11: Mirsham Near 9
## 12: Mirsham Near 31.47977937_34.92723182
## 13: Mirsham Near 31.48033918_34.92626641
## 14: Mirsham Near 1
## 15: Mirsham Near 1
## 16: Mirsham Near 31.48034042_34.92626049
## 17: Mirsham Far 11
## 18: Mirsham Far 11
## 19: Mirsham Far 31.5002719_34.92750673
## 20: Mirsham Far 31.50077201_34.93925215
## 21: Mirsham Far 2
## 22: Mirsham Far 2
## 23: Mirsham Far 31.50077347_34.93924637
## plots
reptiles[conc_lat_lon == '31.47465474_34.9201405', ':=' (settlements = 'Near', point_name = 'Mirsham 81')] # So correct this error
# The planted conifer forest is missing 2 sites in T0 (2014), and one site in T1 (2015) and T4 (2021)
reptiles[unit == 'Planted Conifer Forests' & campaign %in% c('T1', 'T4'), .(plots = unique(point_name)),
keyby = .(campaign, year, subunit,site, Date, start_Time, point_name)]
## campaign year subunit site Date start_Time
## 1: T1 2015 Carmel Bat Shlomo 2015-07-07 09:34:00
## 2: T1 2015 Carmel Bat Shlomo 2015-07-07 10:12:00
## 3: T1 2015 Carmel Elyakim 2015-09-22 10:15:00
## 4: T1 2015 Carmel Elyakim 2015-09-22 11:01:00
## 5: T1 2015 Carmel Elyakim 2015-09-22 11:36:00
## 6: T1 2015 Carmel Kerem Maharal 2015-11-03 11:06:00
## 7: T1 2015 Carmel Kerem Maharal 2015-11-03 11:54:00
## 8: T1 2015 Carmel Ofer 2015-09-16 09:36:00
## 9: T1 2015 Carmel Ofer 2015-09-16 10:09:00
## 10: T1 2015 Carmel Ofer 2015-09-16 10:49:00
## 11: T1 2015 Carmel Ofer 2015-11-03 10:36:00
## 12: T1 2015 Carmel Ramat Hashofet 2015-06-17 14:41:00
## 13: T1 2015 Carmel Ramat Hashofet 2015-06-17 15:16:00
## 14: T1 2015 Carmel Ramat Hashofet 2015-11-03 13:14:00
## 15: T1 2015 Carmel Ramat Hashofet 2015-11-03 13:42:00
## 16: T1 2015 Galilee Kabri 2015-11-04 14:44:00
## 17: T1 2015 Galilee Kabri 2015-11-04 15:23:00
## 18: T1 2015 Galilee Kabri 2015-11-04 15:48:00
## 19: T1 2015 Galilee Manara 2015-05-20 15:50:00
## 20: T1 2015 Galilee Meron 2015-11-25 15:20:00
## 21: T1 2015 Galilee Zuriel 2015-11-25 11:10:00
## 22: T1 2015 Galilee Zuriel 2015-11-25 11:41:00
## 23: T1 2015 Judean Highlands Aderet 2015-09-06 11:26:00
## 24: T1 2015 Judean Highlands Aderet 2015-09-06 12:26:00
## 25: T1 2015 Judean Highlands Aderet 2015-09-06 13:08:00
## 26: T1 2015 Judean Highlands Amatzia 2015-11-15 10:12:00
## 27: T1 2015 Judean Highlands Amatzia 2015-11-15 10:43:00
## 28: T1 2015 Judean Highlands Amatzia 2015-11-15 11:18:00
## 29: T1 2015 Judean Highlands Eitanim 2015-10-21 13:54:00
## 30: T1 2015 Judean Highlands Eitanim 2015-10-21 15:00:00
## 31: T1 2015 Judean Highlands Eshtaol 2015-06-18 10:54:00
## 32: T1 2015 Judean Highlands Givat Yeshayahu 2015-09-06 14:14:00
## 33: T1 2015 Judean Highlands Givat Yeshayahu 2015-09-06 14:59:00
## 34: T1 2015 Judean Highlands Givat Yeshayahu 2015-09-06 15:34:00
## 35: T4 2021 Carmel Bat Shlomo 2021-07-05 10:57:00
## 36: T4 2021 Carmel Bat Shlomo 2021-07-05 11:29:00
## 37: T4 2021 Carmel Bat Shlomo 2021-07-05 11:57:00
## 38: T4 2021 Carmel Elyakim 2021-06-02 15:40:00
## 39: T4 2021 Carmel Elyakim 2021-06-02 16:25:00
## 40: T4 2021 Carmel Elyakim 2021-06-02 17:00:00
## 41: T4 2021 Carmel Kerem Maharal 2021-06-01 16:07:00
## 42: T4 2021 Carmel Kerem Maharal 2021-06-01 16:40:00
## 43: T4 2021 Carmel Kerem Maharal 2021-06-01 17:21:00
## 44: T4 2021 Carmel Ofer 2021-06-04 15:06:00
## 45: T4 2021 Carmel Ofer 2021-06-04 15:44:00
## 46: T4 2021 Carmel Ofer 2021-06-04 16:20:00
## 47: T4 2021 Carmel Ramat Hashofet 2021-07-05 12:45:00
## 48: T4 2021 Carmel Ramat Hashofet 2021-07-05 13:14:00
## 49: T4 2021 Carmel Ramat Hashofet 2021-07-05 13:48:00
## 50: T4 2021 Galilee Manara 2021-05-05 15:41:00
## 51: T4 2021 Galilee Manara 2021-05-05 16:09:00
## 52: T4 2021 Galilee Meron 2021-06-23 14:11:00
## 53: T4 2021 Galilee Meron 2021-06-23 15:06:00
## 54: T4 2021 Galilee Meron 2021-06-23 15:49:00
## 55: T4 2021 Galilee Ramot Naftali 2021-05-05 16:59:00
## 56: T4 2021 Galilee Ramot Naftali 2021-05-05 17:35:00
## 57: T4 2021 Galilee Ramot Naftali 2021-05-05 18:08:00
## 58: T4 2021 Galilee Zuriel 2021-06-23 17:48:00
## 59: T4 2021 Judean Highlands Aderet 2021-05-26 15:18:00
## 60: T4 2021 Judean Highlands Aderet 2021-05-26 15:55:00
## 61: T4 2021 Judean Highlands Aderet 2021-05-26 16:30:00
## 62: T4 2021 Judean Highlands Amatzia 2021-05-26 10:24:00
## 63: T4 2021 Judean Highlands Amatzia 2021-05-26 11:00:00
## 64: T4 2021 Judean Highlands Amatzia 2021-05-26 11:38:00
## 65: T4 2021 Judean Highlands Eitanim 2021-06-15 09:51:00
## 66: T4 2021 Judean Highlands Eshtaol 2021-04-08 09:51:00
## 67: T4 2021 Judean Highlands Eshtaol 2021-04-08 10:30:00
## 68: T4 2021 Judean Highlands Eshtaol 2021-04-08 11:08:00
## 69: T4 2021 Judean Highlands Givat Yeshayahu 2021-05-26 12:40:00
## 70: T4 2021 Judean Highlands Givat Yeshayahu 2021-05-26 13:10:00
## 71: T4 2021 Judean Highlands Givat Yeshayahu 2021-05-26 13:52:00
## campaign year subunit site Date start_Time
## point_name
## 1: Bat Shlomo 32.58547442_35.01415585
## 2: Bat Shlomo 32.58716874_35.01054242
## 3: Elyakim 32.66370396_35.05617847
## 4: Elyakim 32.6672786_35.06301256
## 5: Elyakim 32.66705144_35.05568733
## 6: Kerem Maharal 32.61227564_34.96368766
## 7: Kerem Maharal 32.61601959_34.96652201
## 8: Ofer 32.65474897_34.97793598
## 9: Ofer 32.66030673_34.97882779
## 10: Ofer 32.66114693_34.9686609
## 11: Ofer KKL Plantings 1
## 12: Ramat Hashofet 33.098205_35.564775
## 13: Ramat Hashofet 33.0939666_35.5664466
## 14: Ramat Hashofet 32.61710013_35.11234171
## 15: Ramat Hashofet 32.62225135_35.11265519
## 16: Kabri 33.02024909_35.15766172
## 17: Kabri 33.02051057_35.16410644
## 18: Kabri 33.02076963_35.17121742
## 19: Manara 33.18276851_35.54829503
## 20: Meron 32.99189342_35.45548018
## 21: Zuriel 33.01091098_35.31488335
## 22: Zuriel 33.01398017_35.31735242
## 23: Aderet 31.67867469_34.98154177
## 24: Aderet 31.67577723_34.98668826
## 25: Aderet 31.67144877_34.9880248
## 26: Amatzia 31.51439867_34.8982574
## 27: Amatzia 31.51244719_34.89349107
## 28: Amatzia 31.50751869_34.8949584
## 29: Eitanim 31.77492651_35.09886264
## 30: Eitanim 31.77814645_35.10938566
## 31: Eshtaol 31.79075347_35.01995897
## 32: Givat Yeshayahu 31.66774498_34.92544158
## 33: Givat Yeshayahu 31.6654021_34.91739659
## 34: Givat Yeshayahu 31.67043992_34.92066036
## 35: Bat Shlomo KKL Plantings 3
## 36: Bat Shlomo KKL Plantings 2
## 37: Bat Shlomo KKL Plantings 1
## 38: Elyakim KKL Plantings 3
## 39: Elyakim KKL Plantings 2
## 40: Elyakim KKL Plantings 1
## 41: Kerem Maharal KKL Plantings 2
## 42: Kerem Maharal KKL Plantings 1
## 43: Kerem Maharal KKL Plantings 3
## 44: Ofer KKL Plantings 1
## 45: Ofer KKL Plantings 2
## 46: Ofer KKL Plantings 3
## 47: Ramat Hashofet KKL Plantings 1
## 48: Ramat Hashofet KKL Plantings 4a
## 49: Ramat Hashofet KKL Plantings 2
## 50: Manara KKL Plantings 3
## 51: Manara KKL Plantings 1
## 52: Meron KKL Plantings 3
## 53: Meron KKL Plantings 1
## 54: Meron KKL Plantings 2
## 55: Ramot Naftali KKL Plantings 1
## 56: Ramot Naftali KKL Plantings 3
## 57: Ramot Naftali KKL Plantings 2
## 58: Zuriel KKL Plantings 2
## 59: Aderet KKL Plantings 3
## 60: Aderet KKL Plantings 2
## 61: Aderet KKL Plantings 1
## 62: Amatzia KKL Plantings 3
## 63: Amatzia KKL Plantings 1
## 64: Amatzia KKL Plantings 2
## 65: Eitanim KKL Plantings 2
## 66: Eshtaol KKL Plantings 1
## 67: Eshtaol KKL Plantings 3
## 68: Eshtaol KKL Plantings 4
## 69: Givat Yeshaayahu KKL Plantings 2
## 70: Givat Yeshaayahu KKL Plantings 1
## 71: Givat Yeshaayahu KKL Plantings 3
## point_name
## plots
## 1: Bat Shlomo 32.58547442_35.01415585
## 2: Bat Shlomo 32.58716874_35.01054242
## 3: Elyakim 32.66370396_35.05617847
## 4: Elyakim 32.6672786_35.06301256
## 5: Elyakim 32.66705144_35.05568733
## 6: Kerem Maharal 32.61227564_34.96368766
## 7: Kerem Maharal 32.61601959_34.96652201
## 8: Ofer 32.65474897_34.97793598
## 9: Ofer 32.66030673_34.97882779
## 10: Ofer 32.66114693_34.9686609
## 11: Ofer KKL Plantings 1
## 12: Ramat Hashofet 33.098205_35.564775
## 13: Ramat Hashofet 33.0939666_35.5664466
## 14: Ramat Hashofet 32.61710013_35.11234171
## 15: Ramat Hashofet 32.62225135_35.11265519
## 16: Kabri 33.02024909_35.15766172
## 17: Kabri 33.02051057_35.16410644
## 18: Kabri 33.02076963_35.17121742
## 19: Manara 33.18276851_35.54829503
## 20: Meron 32.99189342_35.45548018
## 21: Zuriel 33.01091098_35.31488335
## 22: Zuriel 33.01398017_35.31735242
## 23: Aderet 31.67867469_34.98154177
## 24: Aderet 31.67577723_34.98668826
## 25: Aderet 31.67144877_34.9880248
## 26: Amatzia 31.51439867_34.8982574
## 27: Amatzia 31.51244719_34.89349107
## 28: Amatzia 31.50751869_34.8949584
## 29: Eitanim 31.77492651_35.09886264
## 30: Eitanim 31.77814645_35.10938566
## 31: Eshtaol 31.79075347_35.01995897
## 32: Givat Yeshayahu 31.66774498_34.92544158
## 33: Givat Yeshayahu 31.6654021_34.91739659
## 34: Givat Yeshayahu 31.67043992_34.92066036
## 35: Bat Shlomo KKL Plantings 3
## 36: Bat Shlomo KKL Plantings 2
## 37: Bat Shlomo KKL Plantings 1
## 38: Elyakim KKL Plantings 3
## 39: Elyakim KKL Plantings 2
## 40: Elyakim KKL Plantings 1
## 41: Kerem Maharal KKL Plantings 2
## 42: Kerem Maharal KKL Plantings 1
## 43: Kerem Maharal KKL Plantings 3
## 44: Ofer KKL Plantings 1
## 45: Ofer KKL Plantings 2
## 46: Ofer KKL Plantings 3
## 47: Ramat Hashofet KKL Plantings 1
## 48: Ramat Hashofet KKL Plantings 4a
## 49: Ramat Hashofet KKL Plantings 2
## 50: Manara KKL Plantings 3
## 51: Manara KKL Plantings 1
## 52: Meron KKL Plantings 3
## 53: Meron KKL Plantings 1
## 54: Meron KKL Plantings 2
## 55: Ramot Naftali KKL Plantings 1
## 56: Ramot Naftali KKL Plantings 3
## 57: Ramot Naftali KKL Plantings 2
## 58: Zuriel KKL Plantings 2
## 59: Aderet KKL Plantings 3
## 60: Aderet KKL Plantings 2
## 61: Aderet KKL Plantings 1
## 62: Amatzia KKL Plantings 3
## 63: Amatzia KKL Plantings 1
## 64: Amatzia KKL Plantings 2
## 65: Eitanim KKL Plantings 2
## 66: Eshtaol KKL Plantings 1
## 67: Eshtaol KKL Plantings 3
## 68: Eshtaol KKL Plantings 4
## 69: Givat Yeshaayahu KKL Plantings 2
## 70: Givat Yeshaayahu KKL Plantings 1
## 71: Givat Yeshaayahu KKL Plantings 3
## plots
bla[unit == 'Planted Conifer Forests' & campaign %in% c('T1', 'T4'), .(plots = unique(point_name)),
keyby = .(campaign, year, subunit, site, Date, start_Time, point_name)]
## campaign year subunit site Date start_Time
## 1: T1 2015 Carmel Bat Shlomo 2015-07-07 09:03:00
## 2: T1 2015 Carmel Bat Shlomo 2015-07-07 09:34:00
## 3: T1 2015 Carmel Bat Shlomo 2015-07-07 10:12:00
## 4: T1 2015 Carmel Elyakim 2015-09-22 10:15:00
## 5: T1 2015 Carmel Elyakim 2015-09-22 11:01:00
## 6: T1 2015 Carmel Elyakim 2015-09-22 11:36:00
## 7: T1 2015 Carmel Kerem Maharal 2015-11-03 11:06:00
## 8: T1 2015 Carmel Kerem Maharal 2015-11-03 11:54:00
## 9: T1 2015 Carmel Ofer 2015-09-16 09:36:00
## 10: T1 2015 Carmel Ofer 2015-09-16 10:09:00
## 11: T1 2015 Carmel Ofer 2015-09-16 10:49:00
## 12: T1 2015 Carmel Ofer 2015-11-03 10:36:00
## 13: T1 2015 Carmel Ramat Hashofet 2015-06-17 14:41:00
## 14: T1 2015 Carmel Ramat Hashofet 2015-06-17 15:16:00
## 15: T1 2015 Carmel Ramat Hashofet 2015-11-03 13:14:00
## 16: T1 2015 Carmel Ramat Hashofet 2015-11-03 13:42:00
## 17: T1 2015 Galilee Kabri 2015-11-04 14:44:00
## 18: T1 2015 Galilee Kabri 2015-11-04 15:23:00
## 19: T1 2015 Galilee Kabri 2015-11-04 15:48:00
## 20: T1 2015 Galilee Manara 2015-05-20 14:40:00
## 21: T1 2015 Galilee Manara 2015-05-20 15:17:00
## 22: T1 2015 Galilee Manara 2015-05-20 15:50:00
## 23: T1 2015 Galilee Meron 2015-11-25 14:23:00
## 24: T1 2015 Galilee Meron 2015-11-25 15:20:00
## 25: T1 2015 Galilee Meron 2015-11-25 16:08:00
## 26: T1 2015 Galilee Ramot Naftali 2015-06-17 13:50:00
## 27: T1 2015 Galilee Zuriel 2015-11-25 11:10:00
## 28: T1 2015 Galilee Zuriel 2015-11-25 11:41:00
## 29: T1 2015 Galilee Zuriel 2015-11-25 12:46:00
## 30: T1 2015 Judean Highlands Aderet 2015-09-06 11:26:00
## 31: T1 2015 Judean Highlands Aderet 2015-09-06 12:26:00
## 32: T1 2015 Judean Highlands Aderet 2015-09-06 13:08:00
## 33: T1 2015 Judean Highlands Amatzia 2015-11-15 10:12:00
## 34: T1 2015 Judean Highlands Amatzia 2015-11-15 10:43:00
## 35: T1 2015 Judean Highlands Amatzia 2015-11-15 11:18:00
## 36: T1 2015 Judean Highlands Eitanim 2015-10-21 13:54:00
## 37: T1 2015 Judean Highlands Eitanim 2015-10-21 14:30:00
## 38: T1 2015 Judean Highlands Eitanim 2015-10-21 15:00:00
## 39: T1 2015 Judean Highlands Eshtaol 2015-06-18 10:54:00
## 40: T1 2015 Judean Highlands Eshtaol 2015-06-18 11:31:00
## 41: T1 2015 Judean Highlands Eshtaol 2015-06-18 12:04:00
## 42: T1 2015 Judean Highlands Givat Yeshayahu 2015-09-06 14:14:00
## 43: T1 2015 Judean Highlands Givat Yeshayahu 2015-09-06 14:59:00
## 44: T1 2015 Judean Highlands Givat Yeshayahu 2015-09-06 15:34:00
## 45: T4 2021 Carmel Bat Shlomo 2021-07-05 10:57:00
## 46: T4 2021 Carmel Bat Shlomo 2021-07-05 11:29:00
## 47: T4 2021 Carmel Bat Shlomo 2021-07-05 11:57:00
## 48: T4 2021 Carmel Elyakim 2021-06-02 15:40:00
## 49: T4 2021 Carmel Elyakim 2021-06-02 16:25:00
## 50: T4 2021 Carmel Elyakim 2021-06-02 17:00:00
## 51: T4 2021 Carmel Kerem Maharal 2021-06-01 16:07:00
## 52: T4 2021 Carmel Kerem Maharal 2021-06-01 16:40:00
## 53: T4 2021 Carmel Kerem Maharal 2021-06-01 17:21:00
## 54: T4 2021 Carmel Ofer 2021-06-04 15:06:00
## 55: T4 2021 Carmel Ofer 2021-06-04 15:44:00
## 56: T4 2021 Carmel Ofer 2021-06-04 16:20:00
## 57: T4 2021 Carmel Ramat Hashofet 2021-07-05 12:45:00
## 58: T4 2021 Carmel Ramat Hashofet 2021-07-05 13:14:00
## 59: T4 2021 Carmel Ramat Hashofet 2021-07-05 13:48:00
## 60: T4 2021 Galilee Kabri 2021-07-05 16:51:00
## 61: T4 2021 Galilee Kabri 2021-07-05 17:44:00
## 62: T4 2021 Galilee Kabri 2021-07-05 18:15:00
## 63: T4 2021 Galilee Manara 2021-05-05 15:10:00
## 64: T4 2021 Galilee Manara 2021-05-05 15:41:00
## 65: T4 2021 Galilee Manara 2021-05-05 16:09:00
## 66: T4 2021 Galilee Meron 2021-06-23 14:11:00
## 67: T4 2021 Galilee Meron 2021-06-23 15:06:00
## 68: T4 2021 Galilee Meron 2021-06-23 15:49:00
## 69: T4 2021 Galilee Ramot Naftali 2021-05-05 16:59:00
## 70: T4 2021 Galilee Ramot Naftali 2021-05-05 17:35:00
## 71: T4 2021 Galilee Ramot Naftali 2021-05-05 18:08:00
## 72: T4 2021 Galilee Zuriel 2021-06-23 17:01:00
## 73: T4 2021 Galilee Zuriel 2021-06-23 17:48:00
## 74: T4 2021 Galilee Zuriel 2021-06-23 18:19:00
## 75: T4 2021 Judean Highlands Aderet 2021-05-26 15:18:00
## 76: T4 2021 Judean Highlands Aderet 2021-05-26 15:55:00
## 77: T4 2021 Judean Highlands Aderet 2021-05-26 16:30:00
## 78: T4 2021 Judean Highlands Amatzia 2021-05-26 10:24:00
## 79: T4 2021 Judean Highlands Amatzia 2021-05-26 11:00:00
## 80: T4 2021 Judean Highlands Amatzia 2021-05-26 11:38:00
## 81: T4 2021 Judean Highlands Eitanim 2021-06-15 09:00:00
## 82: T4 2021 Judean Highlands Eitanim 2021-06-15 09:51:00
## 83: T4 2021 Judean Highlands Eitanim 2021-06-15 10:25:00
## 84: T4 2021 Judean Highlands Eshtaol 2021-04-08 09:51:00
## 85: T4 2021 Judean Highlands Eshtaol 2021-04-08 10:30:00
## 86: T4 2021 Judean Highlands Eshtaol 2021-04-08 11:08:00
## 87: T4 2021 Judean Highlands Givat Yeshayahu 2021-05-26 12:40:00
## 88: T4 2021 Judean Highlands Givat Yeshayahu 2021-05-26 13:10:00
## 89: T4 2021 Judean Highlands Givat Yeshayahu 2021-05-26 13:52:00
## campaign year subunit site Date start_Time
## point_name
## 1: Bat Shlomo Far 1
## 2: Bat Shlomo 32.58547442_35.01415585
## 3: Bat Shlomo 32.58716874_35.01054242
## 4: Elyakim 32.66370396_35.05617847
## 5: Elyakim 32.6672786_35.06301256
## 6: Elyakim 32.66705144_35.05568733
## 7: Kerem Maharal 32.61227564_34.96368766
## 8: Kerem Maharal 32.61601959_34.96652201
## 9: Ofer 32.65474897_34.97793598
## 10: Ofer 32.66030673_34.97882779
## 11: Ofer 32.66114693_34.9686609
## 12: Ofer KKL Plantings 1
## 13: Ramat Hashofet 33.098205_35.564775
## 14: Ramat Hashofet 33.0939666_35.5664466
## 15: Ramat Hashofet 32.61710013_35.11234171
## 16: Ramat Hashofet 32.62225135_35.11265519
## 17: Kabri 33.02024909_35.15766172
## 18: Kabri 33.02051057_35.16410644
## 19: Kabri 33.02076963_35.17121742
## 20: Manara Far 2
## 21: Manara Far 3
## 22: Manara 33.18276851_35.54829503
## 23: Meron Far 1
## 24: Meron 32.99189342_35.45548018
## 25: Meron Far 2
## 26: Ramot Naftali KKL Plantings 1
## 27: Zuriel 33.01091098_35.31488335
## 28: Zuriel 33.01398017_35.31735242
## 29: Zuriel Far 1
## 30: Aderet 31.67867469_34.98154177
## 31: Aderet 31.67577723_34.98668826
## 32: Aderet 31.67144877_34.9880248
## 33: Amatzia 31.51439867_34.8982574
## 34: Amatzia 31.51244719_34.89349107
## 35: Amatzia 31.50751869_34.8949584
## 36: Eitanim 31.77492651_35.09886264
## 37: Eitanim Far 2
## 38: Eitanim 31.77814645_35.10938566
## 39: Eshtaol 31.79075347_35.01995897
## 40: Eshtaol Far 3
## 41: Eshtaol Far 4
## 42: Givat Yeshayahu 31.66774498_34.92544158
## 43: Givat Yeshayahu 31.6654021_34.91739659
## 44: Givat Yeshayahu 31.67043992_34.92066036
## 45: Bat Shlomo KKL Plantings 3
## 46: Bat Shlomo KKL Plantings 2
## 47: Bat Shlomo KKL Plantings 1
## 48: Elyakim KKL Plantings 3
## 49: Elyakim KKL Plantings 2
## 50: Elyakim KKL Plantings 1
## 51: Kerem Maharal KKL Plantings 2
## 52: Kerem Maharal KKL Plantings 1
## 53: Kerem Maharal KKL Plantings 3
## 54: Ofer KKL Plantings 1
## 55: Ofer KKL Plantings 2
## 56: Ofer KKL Plantings 3
## 57: Ramat Hashofet KKL Plantings 1
## 58: Ramat Hashofet KKL Plantings 4a
## 59: Ramat Hashofet KKL Plantings 2
## 60: Kabri KKL Plantings 2
## 61: Kabri KKL Plantings 1
## 62: Kabri KKL Plantings 3
## 63: Manara KKL Plantings 2
## 64: Manara KKL Plantings 3
## 65: Manara KKL Plantings 1
## 66: Meron KKL Plantings 3
## 67: Meron KKL Plantings 1
## 68: Meron KKL Plantings 2
## 69: Ramot Naftali KKL Plantings 1
## 70: Ramot Naftali KKL Plantings 3
## 71: Ramot Naftali KKL Plantings 2
## 72: Zuriel KKL Plantings 1a
## 73: Zuriel KKL Plantings 2
## 74: Zuriel KKL Plantings 3
## 75: Aderet KKL Plantings 3
## 76: Aderet KKL Plantings 2
## 77: Aderet KKL Plantings 1
## 78: Amatzia KKL Plantings 3
## 79: Amatzia KKL Plantings 1
## 80: Amatzia KKL Plantings 2
## 81: Eitanim KKL Plantings 3a
## 82: Eitanim KKL Plantings 2
## 83: Eitanim KKL Plantings 1
## 84: Eshtaol KKL Plantings 1
## 85: Eshtaol KKL Plantings 3
## 86: Eshtaol KKL Plantings 4
## 87: Givat Yeshaayahu KKL Plantings 2
## 88: Givat Yeshaayahu KKL Plantings 1
## 89: Givat Yeshaayahu KKL Plantings 3
## point_name
## plots
## 1: Bat Shlomo Far 1
## 2: Bat Shlomo 32.58547442_35.01415585
## 3: Bat Shlomo 32.58716874_35.01054242
## 4: Elyakim 32.66370396_35.05617847
## 5: Elyakim 32.6672786_35.06301256
## 6: Elyakim 32.66705144_35.05568733
## 7: Kerem Maharal 32.61227564_34.96368766
## 8: Kerem Maharal 32.61601959_34.96652201
## 9: Ofer 32.65474897_34.97793598
## 10: Ofer 32.66030673_34.97882779
## 11: Ofer 32.66114693_34.9686609
## 12: Ofer KKL Plantings 1
## 13: Ramat Hashofet 33.098205_35.564775
## 14: Ramat Hashofet 33.0939666_35.5664466
## 15: Ramat Hashofet 32.61710013_35.11234171
## 16: Ramat Hashofet 32.62225135_35.11265519
## 17: Kabri 33.02024909_35.15766172
## 18: Kabri 33.02051057_35.16410644
## 19: Kabri 33.02076963_35.17121742
## 20: Manara Far 2
## 21: Manara Far 3
## 22: Manara 33.18276851_35.54829503
## 23: Meron Far 1
## 24: Meron 32.99189342_35.45548018
## 25: Meron Far 2
## 26: Ramot Naftali KKL Plantings 1
## 27: Zuriel 33.01091098_35.31488335
## 28: Zuriel 33.01398017_35.31735242
## 29: Zuriel Far 1
## 30: Aderet 31.67867469_34.98154177
## 31: Aderet 31.67577723_34.98668826
## 32: Aderet 31.67144877_34.9880248
## 33: Amatzia 31.51439867_34.8982574
## 34: Amatzia 31.51244719_34.89349107
## 35: Amatzia 31.50751869_34.8949584
## 36: Eitanim 31.77492651_35.09886264
## 37: Eitanim Far 2
## 38: Eitanim 31.77814645_35.10938566
## 39: Eshtaol 31.79075347_35.01995897
## 40: Eshtaol Far 3
## 41: Eshtaol Far 4
## 42: Givat Yeshayahu 31.66774498_34.92544158
## 43: Givat Yeshayahu 31.6654021_34.91739659
## 44: Givat Yeshayahu 31.67043992_34.92066036
## 45: Bat Shlomo KKL Plantings 3
## 46: Bat Shlomo KKL Plantings 2
## 47: Bat Shlomo KKL Plantings 1
## 48: Elyakim KKL Plantings 3
## 49: Elyakim KKL Plantings 2
## 50: Elyakim KKL Plantings 1
## 51: Kerem Maharal KKL Plantings 2
## 52: Kerem Maharal KKL Plantings 1
## 53: Kerem Maharal KKL Plantings 3
## 54: Ofer KKL Plantings 1
## 55: Ofer KKL Plantings 2
## 56: Ofer KKL Plantings 3
## 57: Ramat Hashofet KKL Plantings 1
## 58: Ramat Hashofet KKL Plantings 4a
## 59: Ramat Hashofet KKL Plantings 2
## 60: Kabri KKL Plantings 2
## 61: Kabri KKL Plantings 1
## 62: Kabri KKL Plantings 3
## 63: Manara KKL Plantings 2
## 64: Manara KKL Plantings 3
## 65: Manara KKL Plantings 1
## 66: Meron KKL Plantings 3
## 67: Meron KKL Plantings 1
## 68: Meron KKL Plantings 2
## 69: Ramot Naftali KKL Plantings 1
## 70: Ramot Naftali KKL Plantings 3
## 71: Ramot Naftali KKL Plantings 2
## 72: Zuriel KKL Plantings 1a
## 73: Zuriel KKL Plantings 2
## 74: Zuriel KKL Plantings 3
## 75: Aderet KKL Plantings 3
## 76: Aderet KKL Plantings 2
## 77: Aderet KKL Plantings 1
## 78: Amatzia KKL Plantings 3
## 79: Amatzia KKL Plantings 1
## 80: Amatzia KKL Plantings 2
## 81: Eitanim KKL Plantings 3a
## 82: Eitanim KKL Plantings 2
## 83: Eitanim KKL Plantings 1
## 84: Eshtaol KKL Plantings 1
## 85: Eshtaol KKL Plantings 3
## 86: Eshtaol KKL Plantings 4
## 87: Givat Yeshaayahu KKL Plantings 2
## 88: Givat Yeshaayahu KKL Plantings 1
## 89: Givat Yeshaayahu KKL Plantings 3
## plots
# The planted conifer forest is missing 7 plots in T2, and 6 plots in T2
reptiles[unit == 'Planted Conifer Forests' & campaign %in% c('T2', 'T3'), .(plots = unique(point_name)),
keyby = .(campaign, year, subunit, site, point_name)]
## campaign year subunit site
## 1: T2 2017 Carmel Bat Shlomo
## 2: T2 2017 Carmel Bat Shlomo
## 3: T2 2017 Carmel Bat Shlomo
## 4: T2 2017 Carmel Elyakim
## 5: T2 2017 Carmel Elyakim
## 6: T2 2017 Carmel Elyakim
## 7: T2 2017 Carmel Kerem Maharal
## 8: T2 2017 Carmel Kerem Maharal
## 9: T2 2017 Carmel Kerem Maharal
## 10: T2 2017 Carmel Ofer
## 11: T2 2017 Carmel Ofer
## 12: T2 2017 Carmel Ofer
## 13: T2 2017 Carmel Ramat Hashofet
## 14: T2 2017 Galilee Kabri
## 15: T2 2017 Galilee Kabri
## 16: T2 2017 Galilee Kabri
## 17: T2 2017 Galilee Manara
## 18: T2 2017 Galilee Manara
## 19: T2 2017 Galilee Meron
## 20: T2 2017 Galilee Meron
## 21: T2 2017 Galilee Meron
## 22: T2 2017 Galilee Ramot Naftali
## 23: T2 2017 Galilee Ramot Naftali
## 24: T2 2017 Galilee Ramot Naftali
## 25: T2 2017 Galilee Zuriel
## 26: T2 2017 Judean Highlands Aderet
## 27: T2 2017 Judean Highlands Aderet
## 28: T2 2017 Judean Highlands Aderet
## 29: T2 2017 Judean Highlands Amatzia
## 30: T2 2017 Judean Highlands Amatzia
## 31: T2 2017 Judean Highlands Amatzia
## 32: T2 2017 Judean Highlands Eitanim
## 33: T2 2017 Judean Highlands Eshtaol
## 34: T2 2017 Judean Highlands Eshtaol
## 35: T2 2017 Judean Highlands Eshtaol
## 36: T2 2017 Judean Highlands Givat Yeshayahu
## 37: T2 2017 Judean Highlands Givat Yeshayahu
## 38: T2 2017 Judean Highlands Givat Yeshayahu
## 39: T3 2019 Carmel Bat Shlomo
## 40: T3 2019 Carmel Bat Shlomo
## 41: T3 2019 Carmel Bat Shlomo
## 42: T3 2019 Carmel Elyakim
## 43: T3 2019 Carmel Elyakim
## 44: T3 2019 Carmel Elyakim
## 45: T3 2019 Carmel Kerem Maharal
## 46: T3 2019 Carmel Kerem Maharal
## 47: T3 2019 Carmel Ofer
## 48: T3 2019 Carmel Ofer
## 49: T3 2019 Carmel Ofer
## 50: T3 2019 Carmel Ramat Hashofet
## 51: T3 2019 Carmel Ramat Hashofet
## 52: T3 2019 Carmel Ramat Hashofet
## 53: T3 2019 Galilee Kabri
## 54: T3 2019 Galilee Kabri
## 55: T3 2019 Galilee Kabri
## 56: T3 2019 Galilee Manara
## 57: T3 2019 Galilee Manara
## 58: T3 2019 Galilee Manara
## 59: T3 2019 Galilee Meron
## 60: T3 2019 Galilee Ramot Naftali
## 61: T3 2019 Galilee Ramot Naftali
## 62: T3 2019 Galilee Zuriel
## 63: T3 2019 Galilee Zuriel
## 64: T3 2019 Judean Highlands Aderet
## 65: T3 2019 Judean Highlands Aderet
## 66: T3 2019 Judean Highlands Aderet
## 67: T3 2019 Judean Highlands Amatzia
## 68: T3 2019 Judean Highlands Amatzia
## 69: T3 2019 Judean Highlands Amatzia
## 70: T3 2019 Judean Highlands Eitanim
## 71: T3 2019 Judean Highlands Eitanim
## 72: T3 2019 Judean Highlands Eshtaol
## 73: T3 2019 Judean Highlands Eshtaol
## 74: T3 2019 Judean Highlands Eshtaol
## 75: T3 2019 Judean Highlands Givat Yeshayahu
## 76: T3 2019 Judean Highlands Givat Yeshayahu
## 77: T3 2019 Judean Highlands Givat Yeshayahu
## campaign year subunit site
## point_name plots
## 1: Bat Shlomo KKL Plantings 1 Bat Shlomo KKL Plantings 1
## 2: Bat Shlomo KKL Plantings 2 Bat Shlomo KKL Plantings 2
## 3: Bat Shlomo KKL Plantings 3 Bat Shlomo KKL Plantings 3
## 4: Elyakim KKL Plantings 1 Elyakim KKL Plantings 1
## 5: Elyakim KKL Plantings 2 Elyakim KKL Plantings 2
## 6: Elyakim KKL Plantings 3 Elyakim KKL Plantings 3
## 7: Kerem Maharal KKL Plantings 1 Kerem Maharal KKL Plantings 1
## 8: Kerem Maharal KKL Plantings 2 Kerem Maharal KKL Plantings 2
## 9: Kerem Maharal KKL Plantings 3 Kerem Maharal KKL Plantings 3
## 10: Ofer KKL Plantings 1 Ofer KKL Plantings 1
## 11: Ofer KKL Plantings 2 Ofer KKL Plantings 2
## 12: Ofer KKL Plantings 3 Ofer KKL Plantings 3
## 13: Ramat Hashofet KKL Plantings 4 Ramat Hashofet KKL Plantings 4
## 14: Kabri KKL Plantings 1 Kabri KKL Plantings 1
## 15: Kabri KKL Plantings 2 Kabri KKL Plantings 2
## 16: Kabri KKL Plantings 3 Kabri KKL Plantings 3
## 17: Manara KKL Plantings 2 Manara KKL Plantings 2
## 18: Manara KKL Plantings 3 Manara KKL Plantings 3
## 19: Meron KKL Plantings 1 Meron KKL Plantings 1
## 20: Meron KKL Plantings 2 Meron KKL Plantings 2
## 21: Meron KKL Plantings 3 Meron KKL Plantings 3
## 22: Ramot Naftali KKL Plantings 1 Ramot Naftali KKL Plantings 1
## 23: Ramot Naftali KKL Plantings 2 Ramot Naftali KKL Plantings 2
## 24: Ramot Naftali KKL Plantings 3 Ramot Naftali KKL Plantings 3
## 25: Zuriel KKL Plantings 1 Zuriel KKL Plantings 1
## 26: Aderet KKL Plantings 1 Aderet KKL Plantings 1
## 27: Aderet KKL Plantings 2 Aderet KKL Plantings 2
## 28: Aderet KKL Plantings 3 Aderet KKL Plantings 3
## 29: Amatzia KKL Plantings 1 Amatzia KKL Plantings 1
## 30: Amatzia KKL Plantings 2 Amatzia KKL Plantings 2
## 31: Amatzia KKL Plantings 3 Amatzia KKL Plantings 3
## 32: Eitanim KKL Plantings 1 Eitanim KKL Plantings 1
## 33: Eshtaol KKL Plantings 1 Eshtaol KKL Plantings 1
## 34: Eshtaol KKL Plantings 3 Eshtaol KKL Plantings 3
## 35: Eshtaol KKL Plantings 4 Eshtaol KKL Plantings 4
## 36: Givat Yeshaayahu KKL Plantings 1 Givat Yeshaayahu KKL Plantings 1
## 37: Givat Yeshaayahu KKL Plantings 2 Givat Yeshaayahu KKL Plantings 2
## 38: Givat Yeshaayahu KKL Plantings 3 Givat Yeshaayahu KKL Plantings 3
## 39: Bat Shlomo KKL Plantings 1 Bat Shlomo KKL Plantings 1
## 40: Bat Shlomo KKL Plantings 2 Bat Shlomo KKL Plantings 2
## 41: Bat Shlomo KKL Plantings 3 Bat Shlomo KKL Plantings 3
## 42: Elyakim KKL Plantings 1 Elyakim KKL Plantings 1
## 43: Elyakim KKL Plantings 2 Elyakim KKL Plantings 2
## 44: Elyakim KKL Plantings 3 Elyakim KKL Plantings 3
## 45: Kerem Maharal KKL Plantings 1 Kerem Maharal KKL Plantings 1
## 46: Kerem Maharal KKL Plantings 3 Kerem Maharal KKL Plantings 3
## 47: Ofer KKL Plantings 1 Ofer KKL Plantings 1
## 48: Ofer KKL Plantings 2 Ofer KKL Plantings 2
## 49: Ofer KKL Plantings 3 Ofer KKL Plantings 3
## 50: Ramat Hashofet KKL Plantings 1 Ramat Hashofet KKL Plantings 1
## 51: Ramat Hashofet KKL Plantings 2 Ramat Hashofet KKL Plantings 2
## 52: Ramat Hashofet KKL Plantings 4 Ramat Hashofet KKL Plantings 4
## 53: Kabri KKL Plantings 1 Kabri KKL Plantings 1
## 54: Kabri KKL Plantings 2 Kabri KKL Plantings 2
## 55: Kabri KKL Plantings 3 Kabri KKL Plantings 3
## 56: Manara KKL Plantings 1 Manara KKL Plantings 1
## 57: Manara KKL Plantings 2 Manara KKL Plantings 2
## 58: Manara KKL Plantings 3 Manara KKL Plantings 3
## 59: Meron KKL Plantings 3 Meron KKL Plantings 3
## 60: Ramot Naftali KKL Plantings 1 Ramot Naftali KKL Plantings 1
## 61: Ramot Naftali KKL Plantings 2 Ramot Naftali KKL Plantings 2
## 62: Zuriel KKL Plantings 2 Zuriel KKL Plantings 2
## 63: Zuriel KKL Plantings 3 Zuriel KKL Plantings 3
## 64: Aderet KKL Plantings 3 Aderet KKL Plantings 3
## 65: Aderet KKL Plantings 1 Aderet KKL Plantings 1
## 66: Aderet KKL Plantings 2 Aderet KKL Plantings 2
## 67: Amatzia KKL Plantings 1 Amatzia KKL Plantings 1
## 68: Amatzia KKL Plantings 2 Amatzia KKL Plantings 2
## 69: Amatzia KKL Plantings 3 Amatzia KKL Plantings 3
## 70: Eitanim KKL Plantings 2 Eitanim KKL Plantings 2
## 71: Eitanim KKL Plantings 3 Eitanim KKL Plantings 3
## 72: Eshtaol KKL Plantings 4 Eshtaol KKL Plantings 4
## 73: Eshtaol KKL Plantings 1 Eshtaol KKL Plantings 1
## 74: Eshtaol KKL Plantings 3 Eshtaol KKL Plantings 3
## 75: Givat Yeshaayahu KKL Plantings 1 Givat Yeshaayahu KKL Plantings 1
## 76: Givat Yeshaayahu KKL Plantings 2 Givat Yeshaayahu KKL Plantings 2
## 77: Givat Yeshaayahu KKL Plantings 3 Givat Yeshaayahu KKL Plantings 3
## point_name plots
bla[unit == 'Planted Conifer Forests' & campaign %in% c('T2', 'T3'), .(plots = unique(point_name)),
keyby = .(campaign, year, subunit, site, point_name)]
## campaign year subunit site
## 1: T2 2017 Carmel Bat Shlomo
## 2: T2 2017 Carmel Bat Shlomo
## 3: T2 2017 Carmel Bat Shlomo
## 4: T2 2017 Carmel Elyakim
## 5: T2 2017 Carmel Elyakim
## 6: T2 2017 Carmel Elyakim
## 7: T2 2017 Carmel Kerem Maharal
## 8: T2 2017 Carmel Kerem Maharal
## 9: T2 2017 Carmel Kerem Maharal
## 10: T2 2017 Carmel Ofer
## 11: T2 2017 Carmel Ofer
## 12: T2 2017 Carmel Ofer
## 13: T2 2017 Carmel Ramat Hashofet
## 14: T2 2017 Carmel Ramat Hashofet
## 15: T2 2017 Carmel Ramat Hashofet
## 16: T2 2017 Galilee Kabri
## 17: T2 2017 Galilee Kabri
## 18: T2 2017 Galilee Kabri
## 19: T2 2017 Galilee Manara
## 20: T2 2017 Galilee Manara
## 21: T2 2017 Galilee Manara
## 22: T2 2017 Galilee Meron
## 23: T2 2017 Galilee Meron
## 24: T2 2017 Galilee Meron
## 25: T2 2017 Galilee Ramot Naftali
## 26: T2 2017 Galilee Ramot Naftali
## 27: T2 2017 Galilee Ramot Naftali
## 28: T2 2017 Galilee Zuriel
## 29: T2 2017 Galilee Zuriel
## 30: T2 2017 Galilee Zuriel
## 31: T2 2017 Judean Highlands Aderet
## 32: T2 2017 Judean Highlands Aderet
## 33: T2 2017 Judean Highlands Aderet
## 34: T2 2017 Judean Highlands Amatzia
## 35: T2 2017 Judean Highlands Amatzia
## 36: T2 2017 Judean Highlands Amatzia
## 37: T2 2017 Judean Highlands Eitanim
## 38: T2 2017 Judean Highlands Eitanim
## 39: T2 2017 Judean Highlands Eitanim
## 40: T2 2017 Judean Highlands Eshtaol
## 41: T2 2017 Judean Highlands Eshtaol
## 42: T2 2017 Judean Highlands Eshtaol
## 43: T2 2017 Judean Highlands Givat Yeshayahu
## 44: T2 2017 Judean Highlands Givat Yeshayahu
## 45: T2 2017 Judean Highlands Givat Yeshayahu
## 46: T3 2019 Carmel Bat Shlomo
## 47: T3 2019 Carmel Bat Shlomo
## 48: T3 2019 Carmel Bat Shlomo
## 49: T3 2019 Carmel Elyakim
## 50: T3 2019 Carmel Elyakim
## 51: T3 2019 Carmel Elyakim
## 52: T3 2019 Carmel Kerem Maharal
## 53: T3 2019 Carmel Kerem Maharal
## 54: T3 2019 Carmel Kerem Maharal
## 55: T3 2019 Carmel Ofer
## 56: T3 2019 Carmel Ofer
## 57: T3 2019 Carmel Ofer
## 58: T3 2019 Carmel Ramat Hashofet
## 59: T3 2019 Carmel Ramat Hashofet
## 60: T3 2019 Carmel Ramat Hashofet
## 61: T3 2019 Galilee Kabri
## 62: T3 2019 Galilee Kabri
## 63: T3 2019 Galilee Kabri
## 64: T3 2019 Galilee Manara
## 65: T3 2019 Galilee Manara
## 66: T3 2019 Galilee Manara
## 67: T3 2019 Galilee Meron
## 68: T3 2019 Galilee Meron
## 69: T3 2019 Galilee Meron
## 70: T3 2019 Galilee Ramot Naftali
## 71: T3 2019 Galilee Ramot Naftali
## 72: T3 2019 Galilee Ramot Naftali
## 73: T3 2019 Galilee Zuriel
## 74: T3 2019 Galilee Zuriel
## 75: T3 2019 Galilee Zuriel
## 76: T3 2019 Judean Highlands Aderet
## 77: T3 2019 Judean Highlands Aderet
## 78: T3 2019 Judean Highlands Aderet
## 79: T3 2019 Judean Highlands Amatzia
## 80: T3 2019 Judean Highlands Amatzia
## 81: T3 2019 Judean Highlands Amatzia
## 82: T3 2019 Judean Highlands Eitanim
## 83: T3 2019 Judean Highlands Eitanim
## 84: T3 2019 Judean Highlands Eitanim
## 85: T3 2019 Judean Highlands Eshtaol
## 86: T3 2019 Judean Highlands Eshtaol
## 87: T3 2019 Judean Highlands Eshtaol
## 88: T3 2019 Judean Highlands Givat Yeshayahu
## 89: T3 2019 Judean Highlands Givat Yeshayahu
## 90: T3 2019 Judean Highlands Givat Yeshayahu
## campaign year subunit site
## point_name plots
## 1: Bat Shlomo KKL Plantings 1 Bat Shlomo KKL Plantings 1
## 2: Bat Shlomo KKL Plantings 2 Bat Shlomo KKL Plantings 2
## 3: Bat Shlomo KKL Plantings 3 Bat Shlomo KKL Plantings 3
## 4: Elyakim KKL Plantings 1 Elyakim KKL Plantings 1
## 5: Elyakim KKL Plantings 2 Elyakim KKL Plantings 2
## 6: Elyakim KKL Plantings 3 Elyakim KKL Plantings 3
## 7: Kerem Maharal KKL Plantings 1 Kerem Maharal KKL Plantings 1
## 8: Kerem Maharal KKL Plantings 2 Kerem Maharal KKL Plantings 2
## 9: Kerem Maharal KKL Plantings 3 Kerem Maharal KKL Plantings 3
## 10: Ofer KKL Plantings 1 Ofer KKL Plantings 1
## 11: Ofer KKL Plantings 2 Ofer KKL Plantings 2
## 12: Ofer KKL Plantings 3 Ofer KKL Plantings 3
## 13: Ramat HaShofet - KKL Plantings 1 Ramat HaShofet - KKL Plantings 1
## 14: Ramat HaShofet - KKL Plantings 2 Ramat HaShofet - KKL Plantings 2
## 15: Ramat Hashofet KKL Plantings 4 Ramat Hashofet KKL Plantings 4
## 16: Kabri KKL Plantings 1 Kabri KKL Plantings 1
## 17: Kabri KKL Plantings 2 Kabri KKL Plantings 2
## 18: Kabri KKL Plantings 3 Kabri KKL Plantings 3
## 19: Manara - KKL Plantings 1 Manara - KKL Plantings 1
## 20: Manara KKL Plantings 2 Manara KKL Plantings 2
## 21: Manara KKL Plantings 3 Manara KKL Plantings 3
## 22: Meron KKL Plantings 1 Meron KKL Plantings 1
## 23: Meron KKL Plantings 2 Meron KKL Plantings 2
## 24: Meron KKL Plantings 3 Meron KKL Plantings 3
## 25: Ramot Naftali KKL Plantings 1 Ramot Naftali KKL Plantings 1
## 26: Ramot Naftali KKL Plantings 2 Ramot Naftali KKL Plantings 2
## 27: Ramot Naftali KKL Plantings 3 Ramot Naftali KKL Plantings 3
## 28: Zuriel - KKL Plantings 2 Zuriel - KKL Plantings 2
## 29: Zuriel - KKL Plantings 3 Zuriel - KKL Plantings 3
## 30: Zuriel KKL Plantings 1 Zuriel KKL Plantings 1
## 31: Aderet KKL Plantings 1 Aderet KKL Plantings 1
## 32: Aderet KKL Plantings 2 Aderet KKL Plantings 2
## 33: Aderet KKL Plantings 3 Aderet KKL Plantings 3
## 34: Amatzia KKL Plantings 1 Amatzia KKL Plantings 1
## 35: Amatzia KKL Plantings 2 Amatzia KKL Plantings 2
## 36: Amatzia KKL Plantings 3 Amatzia KKL Plantings 3
## 37: Eitanim KKL Plantings 1 Eitanim KKL Plantings 1
## 38: Eitanim KKL Plantings 2 Eitanim KKL Plantings 2
## 39: Eitanim KKL Plantings 3 Eitanim KKL Plantings 3
## 40: Eshtaol KKL Plantings 1 Eshtaol KKL Plantings 1
## 41: Eshtaol KKL Plantings 3 Eshtaol KKL Plantings 3
## 42: Eshtaol KKL Plantings 4 Eshtaol KKL Plantings 4
## 43: Givat Yeshaayahu KKL Plantings 1 Givat Yeshaayahu KKL Plantings 1
## 44: Givat Yeshaayahu KKL Plantings 2 Givat Yeshaayahu KKL Plantings 2
## 45: Givat Yeshaayahu KKL Plantings 3 Givat Yeshaayahu KKL Plantings 3
## 46: Bat Shlomo KKL Plantings 1 Bat Shlomo KKL Plantings 1
## 47: Bat Shlomo KKL Plantings 2 Bat Shlomo KKL Plantings 2
## 48: Bat Shlomo KKL Plantings 3 Bat Shlomo KKL Plantings 3
## 49: Elyakim KKL Plantings 1 Elyakim KKL Plantings 1
## 50: Elyakim KKL Plantings 2 Elyakim KKL Plantings 2
## 51: Elyakim KKL Plantings 3 Elyakim KKL Plantings 3
## 52: Kerem Maharal KKL Plantings 1 Kerem Maharal KKL Plantings 1
## 53: Kerem Maharal KKL Plantings 2 Kerem Maharal KKL Plantings 2
## 54: Kerem Maharal KKL Plantings 3 Kerem Maharal KKL Plantings 3
## 55: Ofer KKL Plantings 1 Ofer KKL Plantings 1
## 56: Ofer KKL Plantings 2 Ofer KKL Plantings 2
## 57: Ofer KKL Plantings 3 Ofer KKL Plantings 3
## 58: Ramat Hashofet KKL Plantings 1 Ramat Hashofet KKL Plantings 1
## 59: Ramat Hashofet KKL Plantings 2 Ramat Hashofet KKL Plantings 2
## 60: Ramat Hashofet KKL Plantings 4 Ramat Hashofet KKL Plantings 4
## 61: Kabri KKL Plantings 1 Kabri KKL Plantings 1
## 62: Kabri KKL Plantings 2 Kabri KKL Plantings 2
## 63: Kabri KKL Plantings 3 Kabri KKL Plantings 3
## 64: Manara KKL Plantings 1 Manara KKL Plantings 1
## 65: Manara KKL Plantings 2 Manara KKL Plantings 2
## 66: Manara KKL Plantings 3 Manara KKL Plantings 3
## 67: Meron KKL Plantings 1 Meron KKL Plantings 1
## 68: Meron KKL Plantings 2 Meron KKL Plantings 2
## 69: Meron KKL Plantings 3 Meron KKL Plantings 3
## 70: Ramot Naftali KKL Plantings 1 Ramot Naftali KKL Plantings 1
## 71: Ramot Naftali KKL Plantings 2 Ramot Naftali KKL Plantings 2
## 72: Ramot Naftali KKL Plantings 3 Ramot Naftali KKL Plantings 3
## 73: Zuriel KKL Plantings 1 Zuriel KKL Plantings 1
## 74: Zuriel KKL Plantings 2 Zuriel KKL Plantings 2
## 75: Zuriel KKL Plantings 3 Zuriel KKL Plantings 3
## 76: Aderet KKL Plantings 3 Aderet KKL Plantings 3
## 77: Aderet KKL Plantings 1 Aderet KKL Plantings 1
## 78: Aderet KKL Plantings 2 Aderet KKL Plantings 2
## 79: Amatzia KKL Plantings 1 Amatzia KKL Plantings 1
## 80: Amatzia KKL Plantings 2 Amatzia KKL Plantings 2
## 81: Amatzia KKL Plantings 3 Amatzia KKL Plantings 3
## 82: Eitanim KKL Plantings 1 Eitanim KKL Plantings 1
## 83: Eitanim KKL Plantings 2 Eitanim KKL Plantings 2
## 84: Eitanim KKL Plantings 3 Eitanim KKL Plantings 3
## 85: Eshtaol KKL Plantings 4 Eshtaol KKL Plantings 4
## 86: Eshtaol KKL Plantings 1 Eshtaol KKL Plantings 1
## 87: Eshtaol KKL Plantings 3 Eshtaol KKL Plantings 3
## 88: Givat Yeshaayahu KKL Plantings 1 Givat Yeshaayahu KKL Plantings 1
## 89: Givat Yeshaayahu KKL Plantings 2 Givat Yeshaayahu KKL Plantings 2
## 90: Givat Yeshaayahu KKL Plantings 3 Givat Yeshaayahu KKL Plantings 3
## point_name plots
# Missing plots in T1 (2015)
reptiles[unit == 'Planted Conifer Forests' & campaign %in% c('T1'), .(plots = unique(point_name)),
keyby = .(campaign, year, subunit, site, point_name)]
## campaign year subunit site
## 1: T1 2015 Carmel Bat Shlomo
## 2: T1 2015 Carmel Bat Shlomo
## 3: T1 2015 Carmel Elyakim
## 4: T1 2015 Carmel Elyakim
## 5: T1 2015 Carmel Elyakim
## 6: T1 2015 Carmel Kerem Maharal
## 7: T1 2015 Carmel Kerem Maharal
## 8: T1 2015 Carmel Ofer
## 9: T1 2015 Carmel Ofer
## 10: T1 2015 Carmel Ofer
## 11: T1 2015 Carmel Ofer
## 12: T1 2015 Carmel Ramat Hashofet
## 13: T1 2015 Carmel Ramat Hashofet
## 14: T1 2015 Carmel Ramat Hashofet
## 15: T1 2015 Carmel Ramat Hashofet
## 16: T1 2015 Galilee Kabri
## 17: T1 2015 Galilee Kabri
## 18: T1 2015 Galilee Kabri
## 19: T1 2015 Galilee Manara
## 20: T1 2015 Galilee Meron
## 21: T1 2015 Galilee Zuriel
## 22: T1 2015 Galilee Zuriel
## 23: T1 2015 Judean Highlands Aderet
## 24: T1 2015 Judean Highlands Aderet
## 25: T1 2015 Judean Highlands Aderet
## 26: T1 2015 Judean Highlands Amatzia
## 27: T1 2015 Judean Highlands Amatzia
## 28: T1 2015 Judean Highlands Amatzia
## 29: T1 2015 Judean Highlands Eitanim
## 30: T1 2015 Judean Highlands Eitanim
## 31: T1 2015 Judean Highlands Eshtaol
## 32: T1 2015 Judean Highlands Givat Yeshayahu
## 33: T1 2015 Judean Highlands Givat Yeshayahu
## 34: T1 2015 Judean Highlands Givat Yeshayahu
## campaign year subunit site
## point_name
## 1: Bat Shlomo 32.58547442_35.01415585
## 2: Bat Shlomo 32.58716874_35.01054242
## 3: Elyakim 32.66370396_35.05617847
## 4: Elyakim 32.66705144_35.05568733
## 5: Elyakim 32.6672786_35.06301256
## 6: Kerem Maharal 32.61227564_34.96368766
## 7: Kerem Maharal 32.61601959_34.96652201
## 8: Ofer 32.65474897_34.97793598
## 9: Ofer 32.66030673_34.97882779
## 10: Ofer 32.66114693_34.9686609
## 11: Ofer KKL Plantings 1
## 12: Ramat Hashofet 32.61710013_35.11234171
## 13: Ramat Hashofet 32.62225135_35.11265519
## 14: Ramat Hashofet 33.0939666_35.5664466
## 15: Ramat Hashofet 33.098205_35.564775
## 16: Kabri 33.02024909_35.15766172
## 17: Kabri 33.02051057_35.16410644
## 18: Kabri 33.02076963_35.17121742
## 19: Manara 33.18276851_35.54829503
## 20: Meron 32.99189342_35.45548018
## 21: Zuriel 33.01091098_35.31488335
## 22: Zuriel 33.01398017_35.31735242
## 23: Aderet 31.67144877_34.9880248
## 24: Aderet 31.67577723_34.98668826
## 25: Aderet 31.67867469_34.98154177
## 26: Amatzia 31.50751869_34.8949584
## 27: Amatzia 31.51244719_34.89349107
## 28: Amatzia 31.51439867_34.8982574
## 29: Eitanim 31.77492651_35.09886264
## 30: Eitanim 31.77814645_35.10938566
## 31: Eshtaol 31.79075347_35.01995897
## 32: Givat Yeshayahu 31.6654021_34.91739659
## 33: Givat Yeshayahu 31.66774498_34.92544158
## 34: Givat Yeshayahu 31.67043992_34.92066036
## point_name
## plots
## 1: Bat Shlomo 32.58547442_35.01415585
## 2: Bat Shlomo 32.58716874_35.01054242
## 3: Elyakim 32.66370396_35.05617847
## 4: Elyakim 32.66705144_35.05568733
## 5: Elyakim 32.6672786_35.06301256
## 6: Kerem Maharal 32.61227564_34.96368766
## 7: Kerem Maharal 32.61601959_34.96652201
## 8: Ofer 32.65474897_34.97793598
## 9: Ofer 32.66030673_34.97882779
## 10: Ofer 32.66114693_34.9686609
## 11: Ofer KKL Plantings 1
## 12: Ramat Hashofet 32.61710013_35.11234171
## 13: Ramat Hashofet 32.62225135_35.11265519
## 14: Ramat Hashofet 33.0939666_35.5664466
## 15: Ramat Hashofet 33.098205_35.564775
## 16: Kabri 33.02024909_35.15766172
## 17: Kabri 33.02051057_35.16410644
## 18: Kabri 33.02076963_35.17121742
## 19: Manara 33.18276851_35.54829503
## 20: Meron 32.99189342_35.45548018
## 21: Zuriel 33.01091098_35.31488335
## 22: Zuriel 33.01398017_35.31735242
## 23: Aderet 31.67144877_34.9880248
## 24: Aderet 31.67577723_34.98668826
## 25: Aderet 31.67867469_34.98154177
## 26: Amatzia 31.50751869_34.8949584
## 27: Amatzia 31.51244719_34.89349107
## 28: Amatzia 31.51439867_34.8982574
## 29: Eitanim 31.77492651_35.09886264
## 30: Eitanim 31.77814645_35.10938566
## 31: Eshtaol 31.79075347_35.01995897
## 32: Givat Yeshayahu 31.6654021_34.91739659
## 33: Givat Yeshayahu 31.66774498_34.92544158
## 34: Givat Yeshayahu 31.67043992_34.92066036
## plots
bla[unit == 'Planted Conifer Forests' & campaign %in% c('T1'), .(plots = unique(point_name)),
keyby = .(campaign, year, subunit, site, point_name)]
## campaign year subunit site
## 1: T1 2015 Carmel Bat Shlomo
## 2: T1 2015 Carmel Bat Shlomo
## 3: T1 2015 Carmel Bat Shlomo
## 4: T1 2015 Carmel Elyakim
## 5: T1 2015 Carmel Elyakim
## 6: T1 2015 Carmel Elyakim
## 7: T1 2015 Carmel Kerem Maharal
## 8: T1 2015 Carmel Kerem Maharal
## 9: T1 2015 Carmel Ofer
## 10: T1 2015 Carmel Ofer
## 11: T1 2015 Carmel Ofer
## 12: T1 2015 Carmel Ofer
## 13: T1 2015 Carmel Ramat Hashofet
## 14: T1 2015 Carmel Ramat Hashofet
## 15: T1 2015 Carmel Ramat Hashofet
## 16: T1 2015 Carmel Ramat Hashofet
## 17: T1 2015 Galilee Kabri
## 18: T1 2015 Galilee Kabri
## 19: T1 2015 Galilee Kabri
## 20: T1 2015 Galilee Manara
## 21: T1 2015 Galilee Manara
## 22: T1 2015 Galilee Manara
## 23: T1 2015 Galilee Meron
## 24: T1 2015 Galilee Meron
## 25: T1 2015 Galilee Meron
## 26: T1 2015 Galilee Ramot Naftali
## 27: T1 2015 Galilee Zuriel
## 28: T1 2015 Galilee Zuriel
## 29: T1 2015 Galilee Zuriel
## 30: T1 2015 Judean Highlands Aderet
## 31: T1 2015 Judean Highlands Aderet
## 32: T1 2015 Judean Highlands Aderet
## 33: T1 2015 Judean Highlands Amatzia
## 34: T1 2015 Judean Highlands Amatzia
## 35: T1 2015 Judean Highlands Amatzia
## 36: T1 2015 Judean Highlands Eitanim
## 37: T1 2015 Judean Highlands Eitanim
## 38: T1 2015 Judean Highlands Eitanim
## 39: T1 2015 Judean Highlands Eshtaol
## 40: T1 2015 Judean Highlands Eshtaol
## 41: T1 2015 Judean Highlands Eshtaol
## 42: T1 2015 Judean Highlands Givat Yeshayahu
## 43: T1 2015 Judean Highlands Givat Yeshayahu
## 44: T1 2015 Judean Highlands Givat Yeshayahu
## campaign year subunit site
## point_name
## 1: Bat Shlomo 32.58547442_35.01415585
## 2: Bat Shlomo 32.58716874_35.01054242
## 3: Bat Shlomo Far 1
## 4: Elyakim 32.66370396_35.05617847
## 5: Elyakim 32.66705144_35.05568733
## 6: Elyakim 32.6672786_35.06301256
## 7: Kerem Maharal 32.61227564_34.96368766
## 8: Kerem Maharal 32.61601959_34.96652201
## 9: Ofer 32.65474897_34.97793598
## 10: Ofer 32.66030673_34.97882779
## 11: Ofer 32.66114693_34.9686609
## 12: Ofer KKL Plantings 1
## 13: Ramat Hashofet 32.61710013_35.11234171
## 14: Ramat Hashofet 32.62225135_35.11265519
## 15: Ramat Hashofet 33.0939666_35.5664466
## 16: Ramat Hashofet 33.098205_35.564775
## 17: Kabri 33.02024909_35.15766172
## 18: Kabri 33.02051057_35.16410644
## 19: Kabri 33.02076963_35.17121742
## 20: Manara 33.18276851_35.54829503
## 21: Manara Far 2
## 22: Manara Far 3
## 23: Meron 32.99189342_35.45548018
## 24: Meron Far 1
## 25: Meron Far 2
## 26: Ramot Naftali KKL Plantings 1
## 27: Zuriel 33.01091098_35.31488335
## 28: Zuriel 33.01398017_35.31735242
## 29: Zuriel Far 1
## 30: Aderet 31.67144877_34.9880248
## 31: Aderet 31.67577723_34.98668826
## 32: Aderet 31.67867469_34.98154177
## 33: Amatzia 31.50751869_34.8949584
## 34: Amatzia 31.51244719_34.89349107
## 35: Amatzia 31.51439867_34.8982574
## 36: Eitanim 31.77492651_35.09886264
## 37: Eitanim 31.77814645_35.10938566
## 38: Eitanim Far 2
## 39: Eshtaol 31.79075347_35.01995897
## 40: Eshtaol Far 3
## 41: Eshtaol Far 4
## 42: Givat Yeshayahu 31.6654021_34.91739659
## 43: Givat Yeshayahu 31.66774498_34.92544158
## 44: Givat Yeshayahu 31.67043992_34.92066036
## point_name
## plots
## 1: Bat Shlomo 32.58547442_35.01415585
## 2: Bat Shlomo 32.58716874_35.01054242
## 3: Bat Shlomo Far 1
## 4: Elyakim 32.66370396_35.05617847
## 5: Elyakim 32.66705144_35.05568733
## 6: Elyakim 32.6672786_35.06301256
## 7: Kerem Maharal 32.61227564_34.96368766
## 8: Kerem Maharal 32.61601959_34.96652201
## 9: Ofer 32.65474897_34.97793598
## 10: Ofer 32.66030673_34.97882779
## 11: Ofer 32.66114693_34.9686609
## 12: Ofer KKL Plantings 1
## 13: Ramat Hashofet 32.61710013_35.11234171
## 14: Ramat Hashofet 32.62225135_35.11265519
## 15: Ramat Hashofet 33.0939666_35.5664466
## 16: Ramat Hashofet 33.098205_35.564775
## 17: Kabri 33.02024909_35.15766172
## 18: Kabri 33.02051057_35.16410644
## 19: Kabri 33.02076963_35.17121742
## 20: Manara 33.18276851_35.54829503
## 21: Manara Far 2
## 22: Manara Far 3
## 23: Meron 32.99189342_35.45548018
## 24: Meron Far 1
## 25: Meron Far 2
## 26: Ramot Naftali KKL Plantings 1
## 27: Zuriel 33.01091098_35.31488335
## 28: Zuriel 33.01398017_35.31735242
## 29: Zuriel Far 1
## 30: Aderet 31.67144877_34.9880248
## 31: Aderet 31.67577723_34.98668826
## 32: Aderet 31.67867469_34.98154177
## 33: Amatzia 31.50751869_34.8949584
## 34: Amatzia 31.51244719_34.89349107
## 35: Amatzia 31.51439867_34.8982574
## 36: Eitanim 31.77492651_35.09886264
## 37: Eitanim 31.77814645_35.10938566
## 38: Eitanim Far 2
## 39: Eshtaol 31.79075347_35.01995897
## 40: Eshtaol Far 3
## 41: Eshtaol Far 4
## 42: Givat Yeshayahu 31.6654021_34.91739659
## 43: Givat Yeshayahu 31.66774498_34.92544158
## 44: Givat Yeshayahu 31.67043992_34.92066036
## plots
#
reptiles <- copy(bla) # use the data base with the missing zero observations
rm(bla) # clean up
# Find and export the excessive plots:
excessive_plots <- reptiles[(site == 'Hatzerim') |
(site %in% c('Nahal Ashan', 'Sayeret Shaked') & campaign == 'T0') |
(campaign == 'T0' & site == 'Lehavim' & settlements == 'Near') |
(campaign == 'T1' & site %in% c('Ofer', 'Ramat Hashofet')),
.(longitude = unique(longitude), latitude = unique(latitude)),
keyby = .(campaign, site, Date, year, habitat, point_name, settlements)]
excessive_plots <- excessive_plots[!(site == 'Sayeret Shaked' & habitat == 'kkl plantings')]
st_write(st_as_sf(excessive_plots[!is.na(longitude)], coords = c('longitude', 'latitude'), crs = 4326, remove = F),
'Analysis/Excessive reptile plots.shp', append = F) # Export the excessive plots as an ESRI shapefile
## Warning in abbreviate_shapefile_names(obj): Field names abbreviated for ESRI
## Shapefile driver
## Deleting layer `Excessive reptile plots' using driver `ESRI Shapefile'
## Writing layer `Excessive reptile plots' to data source
## `Analysis/Excessive reptile plots.shp' using driver `ESRI Shapefile'
## Writing 20 features with 9 fields and geometry type Point.
st_write(st_as_sf(excessive_plots[!is.na(longitude)], coords = c('longitude', 'latitude'), crs = 4326, remove = F),
'Analysis/Excessive reptile plots.gpkg', append = F) # Export the excessive plots as a geopackage
## Deleting layer `Excessive reptile plots' using driver `GPKG'
## Writing layer `Excessive reptile plots' to data source
## `Analysis/Excessive reptile plots.gpkg' using driver `GPKG'
## Writing 20 features with 9 fields and geometry type Point.
reptiles[site == 'Ramat Hashofet', .(unique(point_name)), keyby = .(campaign, Date, latitude, longitude)]
## campaign Date latitude longitude
## 1: T0 2014-07-22 NA NA
## 2: T0 2014-07-22 32.61716 35.11097
## 3: T0 2014-07-22 32.62246 35.11242
## 4: T1 2015-06-17 33.09397 35.56645
## 5: T1 2015-06-17 33.09821 35.56477
## 6: T1 2015-11-03 32.61710 35.11234
## 7: T1 2015-11-03 32.62225 35.11266
## 8: T2 2017-08-01 32.60958 35.11596
## 9: T2 2017-08-01 32.61716 35.11097
## 10: T2 2017-08-01 32.62246 35.11242
## 11: T3 2019-06-29 32.60958 35.11596
## 12: T3 2019-06-29 32.61710 35.11234
## 13: T3 2019-06-29 32.62225 35.11266
## 14: T4 2021-07-05 32.60910 35.11071
## 15: T4 2021-07-05 32.61710 35.11234
## 16: T4 2021-07-05 32.62225 35.11266
## V1
## 1: Ramat HaShofet - KKL Plantings 3
## 2: Ramat HaShofet - KKL Plantings 1
## 3: Ramat HaShofet - KKL Plantings 2
## 4: Ramat Hashofet 33.0939666_35.5664466
## 5: Ramat Hashofet 33.098205_35.564775
## 6: Ramat Hashofet 32.61710013_35.11234171
## 7: Ramat Hashofet 32.62225135_35.11265519
## 8: Ramat Hashofet KKL Plantings 4
## 9: Ramat HaShofet - KKL Plantings 1
## 10: Ramat HaShofet - KKL Plantings 2
## 11: Ramat Hashofet KKL Plantings 4
## 12: Ramat Hashofet KKL Plantings 1
## 13: Ramat Hashofet KKL Plantings 2
## 14: Ramat Hashofet KKL Plantings 4a
## 15: Ramat Hashofet KKL Plantings 1
## 16: Ramat Hashofet KKL Plantings 2
# only in T1 we have two "Ramat HaShofet" plots which are very, very far away from Ramat HaShofet itself (near Ramot Naftali - might be the cause of confusion?)
reptiles[site == 'Ramat Hashofet' & latitude > 33, .(unique(point_name)), keyby = .(latitude, longitude)] # indeed
## latitude longitude V1
## 1: 33.09397 35.56645 Ramat Hashofet 33.0939666_35.5664466
## 2: 33.09821 35.56477 Ramat Hashofet 33.098205_35.564775
reptiles[site == 'Ramat Hashofet' & latitude > 33, ':=' (site = 'Ramot Naftali', subunit = 'Galilee')] # update the data accordingly
reptiles[site == 'Ramot Naftali' & campaign == 'T1']
## site point_name campaign year
## 1: Ramot Naftali Ramat Hashofet 33.0939666_35.5664466 T1 2015
## 2: Ramot Naftali Ramat Hashofet 33.0939666_35.5664466 T1 2015
## 3: Ramot Naftali Ramat Hashofet 33.0939666_35.5664466 T1 2015
## 4: Ramot Naftali Ramat Hashofet 33.0939666_35.5664466 T1 2015
## 5: Ramot Naftali Ramat Hashofet 33.0939666_35.5664466 T1 2015
## 6: Ramot Naftali Ramat Hashofet 33.098205_35.564775 T1 2015
## 7: Ramot Naftali Ramat Hashofet 33.098205_35.564775 T1 2015
## 8: Ramot Naftali Ramat Hashofet 33.098205_35.564775 T1 2015
## 9: Ramot Naftali Ramot Naftali KKL Plantings 1 T1 2015
## unit subunit settlements agriculture habitat dunes
## 1: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## 2: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## 3: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## 4: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## 5: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## 6: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## 7: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## 8: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## 9: Planted Conifer Forests Galilee <NA> <NA> <NA> <NA>
## observations_id latitude longitude date time date_end time_end
## 1: 33.09397 35.56645 17/06/2015 15:16:00
## 2: 33.09397 35.56645 17/06/2015 15:16:00
## 3: 33.09397 35.56645 17/06/2015 15:16:00
## 4: 33.09397 35.56645 17/06/2015 15:16:00
## 5: 33.09397 35.56645 17/06/2015 15:16:00
## 6: 33.09821 35.56477 17/06/2015 14:41:00
## 7: 33.09821 35.56477 17/06/2015 14:41:00
## 8: 33.09821 35.56477 17/06/2015 14:41:00
## 9: <NA> 33.09508 35.56110 <NA> <NA> <NA> <NA>
## activity orientation type body tail tail_type
## 1: moving in leaf litter NA <NA> regenerated
## 2: moving on leaf litter NA <NA> original
## 3: slough under rock NA <NA> <NA>
## 4: slough near annuals NA <NA> <NA>
## 5: shelter under rock NA 13 broken
## 6: shelter under rock NA <NA> <NA>
## 7: eggshell on leaf litter NA <NA> <NA>
## 8: slough under rock NA <NA> <NA>
## 9: <NA> <NA> <NA> NA <NA> <NA>
## SciName stones_flipped weather temp_shade temp_sun
## 1: Ablepharus rueppellii NA <NA> NA NA
## 2: Ablepharus rueppellii NA <NA> NA NA
## 3: Chalcides ocellatus NA <NA> NA NA
## 4: Chamaeleo chamaeleon NA <NA> NA NA
## 5: Mediodactylus kotschyi NA <NA> NA NA
## 6: Ablepharus rueppellii NA <NA> NA NA
## 7: Testudo graeca NA <NA> NA NA
## 8: Heremites vittatus NA <NA> NA NA
## 9: <NA> NA <NA> NA NA
## site_description obs_snout_len obs_tail_len obs_regentail_len material
## 1: <NA> NA NA NA <NA>
## 2: <NA> NA NA NA <NA>
## 3: <NA> NA NA NA <NA>
## 4: <NA> NA NA NA <NA>
## 5: <NA> NA NA NA <NA>
## 6: <NA> NA NA NA <NA>
## 7: <NA> NA NA NA <NA>
## 8: <NA> NA NA NA <NA>
## 9: <NA> NA NA NA <NA>
## obs_notes disturbance sv t regen_t substrate survey_protocol
## 1: <NA> <NA> NA NA NA <NA> scan
## 2: <NA> <NA> NA NA NA <NA> scan
## 3: <NA> <NA> NA NA NA <NA> scan
## 4: <NA> <NA> NA NA NA <NA> scan
## 5: <NA> <NA> NA NA NA <NA> scan
## 6: <NA> <NA> NA NA NA <NA> scan
## 7: <NA> <NA> NA NA NA <NA> scan
## 8: <NA> <NA> NA NA NA <NA> scan
## 9: <NA> <NA> NA NA NA <NA> <NA>
## count_individuals weather_desc wind sex_new age observation_type Column
## 1: 1 <NA> <NA> <NA> adult direct <NA>
## 2: 2 <NA> <NA> <NA> adult direct <NA>
## 3: 1 <NA> <NA> <NA> <NA> indirect <NA>
## 4: 1 <NA> <NA> <NA> <NA> indirect <NA>
## 5: 1 <NA> <NA> male <NA> direct <NA>
## 6: 1 <NA> <NA> <NA> subadult direct <NA>
## 7: 1 <NA> <NA> <NA> <NA> indirect <NA>
## 8: 1 <NA> <NA> <NA> <NA> indirect <NA>
## 9: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## mean.lat mean.lon conc_lat_lon Date ITime start_Time
## 1: 33.09397 35.56645 33.0939666_35.5664466 2015-06-17 14:16:00 15:16:00
## 2: 33.09397 35.56645 33.0939666_35.5664466 2015-06-17 14:16:00 15:16:00
## 3: 33.09397 35.56645 33.0939666_35.5664466 2015-06-17 14:16:00 15:16:00
## 4: 33.09397 35.56645 33.0939666_35.5664466 2015-06-17 14:16:00 15:16:00
## 5: 33.09397 35.56645 33.0939666_35.5664466 2015-06-17 14:16:00 15:16:00
## 6: 33.09821 35.56477 33.098205_35.564775 2015-06-17 13:41:00 14:41:00
## 7: 33.09821 35.56477 33.098205_35.564775 2015-06-17 13:41:00 14:41:00
## 8: 33.09821 35.56477 33.098205_35.564775 2015-06-17 13:41:00 14:41:00
## 9: NA NA <NA> 2015-06-17 13:50:00 13:50:00
## Date.time Comments
## 1: 2015-06-17 14:16:00 <NA>
## 2: 2015-06-17 14:16:00 <NA>
## 3: 2015-06-17 14:16:00 <NA>
## 4: 2015-06-17 14:16:00 <NA>
## 5: 2015-06-17 14:16:00 <NA>
## 6: 2015-06-17 13:41:00 <NA>
## 7: 2015-06-17 13:41:00 <NA>
## 8: 2015-06-17 13:41:00 <NA>
## 9: <NA> <NA>
reptiles[is.na(point_name), .N] # 41 cases of missing point name
## [1] 0
reptiles[is.na(point_name) & is.na(conc_lat_lon)] # only one case when both point name and con_lat_lon are missing
## Empty data.table (0 rows and 55 cols): site,point_name,campaign,year,unit,subunit...
reptiles[is.na(point_name) & !is.na(conc_lat_lon), point_name := conc_lat_lon]
# Look for missing plots and sites, that might indicate visits yielding no reptiles at all
campaigns.per.plot <- reptiles[, .(no.of.campaigns.surveyed = uniqueN(campaign)), keyby = .(unit, site, point_name)]
campaigns.per.plot[, total.campaigns.per.unit := max(no.of.campaigns.surveyed), keyby = unit]
campaigns.per.plot[no.of.campaigns.surveyed < total.campaigns.per.unit] # 367 is far too many plots surveyed less than once per campaign
## unit site point_name
## 1: Coastal Plain Sands Ashdod Ashdod Far Shifting 1
## 2: Coastal Plain Sands Ashdod Ashdod Far Shifting 2
## 3: Coastal Plain Sands Ashdod Ashdod Far Shifting 3
## 4: Coastal Plain Sands Ashdod Ashdod Far shifting 1
## 5: Coastal Plain Sands Ashdod Ashdod Far shifting 2
## ---
## 363: Planted Conifer Forests Zuriel Zuriel Far 1
## 364: Planted Conifer Forests Zuriel Zuriel KKL Plantings 1
## 365: Planted Conifer Forests Zuriel Zuriel KKL Plantings 1a
## 366: Planted Conifer Forests Zuriel Zuriel KKL Plantings 2
## 367: Planted Conifer Forests Zuriel Zuriel KKL Plantings 3
## no.of.campaigns.surveyed total.campaigns.per.unit
## 1: 4 5
## 2: 4 5
## 3: 4 5
## 4: 2 5
## 5: 2 5
## ---
## 363: 1 4
## 364: 3 4
## 365: 1 4
## 366: 2 4
## 367: 2 4
reptiles[, point_name := str_to_title(str_replace(point_name, pattern = ' ', replacement = ' '))]
survey.plots <- st_as_sf(reptiles[!is.na(mean.lat) & !is.na(mean.lon),
.(mean.lon = unique(mean.lon)), keyby = .(unit, site, subunit, settlements, habitat, dunes, point_name, mean.lat, conc_lat_lon)],
coords = c('mean.lon', 'mean.lat'), crs = 4326, remove = F)
uniqueN(survey.plots$point_name) == nrow(survey.plots)
## [1] FALSE
# Calculate all distances between plots in the same site, to look for multiplications
plot.distances.all <- data.table(plot = '', conc_lat_lon = '', distance_to_plot = '', distance_m = as.numeric(NA), unit = '', site = '') # Create a data.table to be filled by the loop below
plot.distances.all <- plot.distances.all[plot != ''] # Empty the data.table
str(plot.distances.all)
## Classes 'data.table' and 'data.frame': 0 obs. of 6 variables:
## $ plot : chr
## $ conc_lat_lon : chr
## $ distance_to_plot: chr
## $ distance_m : num
## $ unit : chr
## $ site : chr
## - attr(*, ".internal.selfref")=<externalptr>
for (i in sort(unique(survey.plots$site))) {
unit <- as.data.table(survey.plots)[site == i, unique(unit)]
plot.distances <- as.data.table(st_distance(survey.plots[which(survey.plots$site == i),]))
names(plot.distances) <- as.data.table(survey.plots)[site == i, as.character(point_name)]
plot.distances[, ':=' (plot = as.data.table(survey.plots)[site == i, as.character(point_name)],
conc_lat_lon = as.data.table(survey.plots)[site == i, as.character(conc_lat_lon)])]
# setcolorder(plot.distances, 'plot')
plot.distances.melt <- melt.data.table(plot.distances, id.vars = c('plot', 'conc_lat_lon'), variable.name = 'distance_to_plot', value.name = 'distance_m')
plot.distances.melt[, ':=' (unit = unit, site = i, distance_m = as.numeric(distance_m))]
plot.distances.all <- rbind(plot.distances.all, plot.distances.melt)
rm(plot.distances, plot.distances.melt, unit) # clean up
}
plot.distances.all <- unique(plot.distances.all[plot != distance_to_plot]) # Remove self-distances
plot.distances.all <- merge(plot.distances.all, as.data.table(survey.plots)[, .(mean.lat, mean.lon), keyby = .(plot = point_name, subunit, habitat, settlements, dunes)],
by = 'plot', all.x = T) # add coordinates
plot.distances.all <- merge(plot.distances.all, as.data.table(survey.plots)[, .(distance_to_plot = point_name, subunit, habitat, settlements, dunes)],
by = 'distance_to_plot', all.x = T) # add coordinates
# Plot the distances between plots
setorder(plot.distances.all, distance_m) # sort by distance between plots
plot(plot.distances.all$distance_m) # up to 10 km between plots
plot(plot.distances.all[distance_m < 2000, distance_m]) # zoom in more and more
plot(plot.distances.all[distance_m < 500, distance_m])
plot(plot.distances.all[distance_m < 150, distance_m])
plot(plot.distances.all[distance_m < 50, distance_m]) # 3-5 meters seems like a valid cut-off
plot.distances.same.att <- plot.distances.all[(settlements.x == settlements.y) | is.na(settlements.x)]
plot.distances.same.att <- plot.distances.same.att[(habitat.x == habitat.y) | is.na(habitat.x)]
plot.distances.same.att <- plot.distances.same.att[(dunes.x == dunes.y) | is.na(dunes.x)]
plot.distances.same.att <- plot.distances.same.att[(subunit.x == subunit.y) | is.na(subunit.x)]
setorder(plot.distances.same.att, unit, subunit.x, habitat.x, settlements.x, dunes.x, mean.lat) # Order by unit, site and latitude
plot.distances.same.att[distance_m < 10] # No fewer than 434 plots less than 10 meters away from each other
## distance_to_plot plot
## 1: Ashkelon Near Semi-Shifting 1 Near Semi-Shifting 1
## 2: Near Semi-Shifting 1 Ashkelon Near Semi-Shifting 1
## 3: Ashkelon Near Semi-Shifting 2 Near Semi-Shifting 2
## 4: Near Semi-Shifting 2 Ashkelon Near Semi-Shifting 2
## 5: Ashkelon Near Semi-Shifting 3 Near Semi-Shifting 3
## ---
## 430: Eshtaol Kkl Plantings 4 Eshtaol 31.78378561_35.02056481
## 431: Eshtaol 31.78694021_35.02193935 Eshtaol Kkl Plantings 3
## 432: Eshtaol Kkl Plantings 3 Eshtaol 31.78694021_35.02193935
## 433: Eshtaol 31.79075347_35.01995897 Eshtaol Kkl Plantings 1
## 434: Eshtaol Kkl Plantings 1 Eshtaol 31.79075347_35.01995897
## conc_lat_lon distance_m unit site
## 1: 31.70919784_34.60432269 0.0000000 Coastal Plain Sands Ashkelon
## 2: 31.70919784_34.60432269 0.0000000 Coastal Plain Sands Ashkelon
## 3: 31.73060424_34.62138511 0.0000000 Coastal Plain Sands Ashkelon
## 4: 31.73060424_34.62138511 0.0000000 Coastal Plain Sands Ashkelon
## 5: 31.73423081_34.61718501 0.0000000 Coastal Plain Sands Ashkelon
## ---
## 430: 31.78378561_35.02056481 0.6849177 Planted Conifer Forests Eshtaol
## 431: 31.78693565_35.02194425 0.6867263 Planted Conifer Forests Eshtaol
## 432: 31.78694021_35.02193935 0.6867263 Planted Conifer Forests Eshtaol
## 433: 31.79075347_35.01995897 0.0000000 Planted Conifer Forests Eshtaol
## 434: 31.79075347_35.01995897 0.0000000 Planted Conifer Forests Eshtaol
## subunit.x habitat.x settlements.x dunes.x mean.lat mean.lon
## 1: <NA> <NA> Near semi-shifting 31.70920 34.60432
## 2: <NA> <NA> Near semi-shifting 31.70920 34.60432
## 3: <NA> <NA> Near semi-shifting 31.73060 34.62139
## 4: <NA> <NA> Near semi-shifting 31.73060 34.62139
## 5: <NA> <NA> Near semi-shifting 31.73423 34.61719
## ---
## 430: Judean Highlands <NA> <NA> <NA> 31.78379 35.02056
## 431: Judean Highlands <NA> <NA> <NA> 31.78694 35.02194
## 432: Judean Highlands <NA> <NA> <NA> 31.78694 35.02194
## 433: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## 434: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## subunit.y habitat.y settlements.y dunes.y
## 1: <NA> <NA> Near semi-shifting
## 2: <NA> <NA> Near semi-shifting
## 3: <NA> <NA> Near semi-shifting
## 4: <NA> <NA> Near semi-shifting
## 5: <NA> <NA> Near semi-shifting
## ---
## 430: Judean Highlands <NA> <NA> <NA>
## 431: Judean Highlands <NA> <NA> <NA>
## 432: Judean Highlands <NA> <NA> <NA>
## 433: Judean Highlands <NA> <NA> <NA>
## 434: Judean Highlands <NA> <NA> <NA>
plot.distances.same.att[distance_m < 5] # Same, less than 5 meters away
## distance_to_plot plot
## 1: Ashkelon Near Semi-Shifting 1 Near Semi-Shifting 1
## 2: Near Semi-Shifting 1 Ashkelon Near Semi-Shifting 1
## 3: Ashkelon Near Semi-Shifting 2 Near Semi-Shifting 2
## 4: Near Semi-Shifting 2 Ashkelon Near Semi-Shifting 2
## 5: Ashkelon Near Semi-Shifting 3 Near Semi-Shifting 3
## ---
## 430: Eshtaol Kkl Plantings 4 Eshtaol 31.78378561_35.02056481
## 431: Eshtaol 31.78694021_35.02193935 Eshtaol Kkl Plantings 3
## 432: Eshtaol Kkl Plantings 3 Eshtaol 31.78694021_35.02193935
## 433: Eshtaol 31.79075347_35.01995897 Eshtaol Kkl Plantings 1
## 434: Eshtaol Kkl Plantings 1 Eshtaol 31.79075347_35.01995897
## conc_lat_lon distance_m unit site
## 1: 31.70919784_34.60432269 0.0000000 Coastal Plain Sands Ashkelon
## 2: 31.70919784_34.60432269 0.0000000 Coastal Plain Sands Ashkelon
## 3: 31.73060424_34.62138511 0.0000000 Coastal Plain Sands Ashkelon
## 4: 31.73060424_34.62138511 0.0000000 Coastal Plain Sands Ashkelon
## 5: 31.73423081_34.61718501 0.0000000 Coastal Plain Sands Ashkelon
## ---
## 430: 31.78378561_35.02056481 0.6849177 Planted Conifer Forests Eshtaol
## 431: 31.78693565_35.02194425 0.6867263 Planted Conifer Forests Eshtaol
## 432: 31.78694021_35.02193935 0.6867263 Planted Conifer Forests Eshtaol
## 433: 31.79075347_35.01995897 0.0000000 Planted Conifer Forests Eshtaol
## 434: 31.79075347_35.01995897 0.0000000 Planted Conifer Forests Eshtaol
## subunit.x habitat.x settlements.x dunes.x mean.lat mean.lon
## 1: <NA> <NA> Near semi-shifting 31.70920 34.60432
## 2: <NA> <NA> Near semi-shifting 31.70920 34.60432
## 3: <NA> <NA> Near semi-shifting 31.73060 34.62139
## 4: <NA> <NA> Near semi-shifting 31.73060 34.62139
## 5: <NA> <NA> Near semi-shifting 31.73423 34.61719
## ---
## 430: Judean Highlands <NA> <NA> <NA> 31.78379 35.02056
## 431: Judean Highlands <NA> <NA> <NA> 31.78694 35.02194
## 432: Judean Highlands <NA> <NA> <NA> 31.78694 35.02194
## 433: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## 434: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## subunit.y habitat.y settlements.y dunes.y
## 1: <NA> <NA> Near semi-shifting
## 2: <NA> <NA> Near semi-shifting
## 3: <NA> <NA> Near semi-shifting
## 4: <NA> <NA> Near semi-shifting
## 5: <NA> <NA> Near semi-shifting
## ---
## 430: Judean Highlands <NA> <NA> <NA>
## 431: Judean Highlands <NA> <NA> <NA>
## 432: Judean Highlands <NA> <NA> <NA>
## 433: Judean Highlands <NA> <NA> <NA>
## 434: Judean Highlands <NA> <NA> <NA>
plot.distances.same.att[distance_m < 2] # only 414 plots less than 2 meters away from each other
## distance_to_plot plot
## 1: Ashkelon Near Semi-Shifting 1 Near Semi-Shifting 1
## 2: Near Semi-Shifting 1 Ashkelon Near Semi-Shifting 1
## 3: Ashkelon Near Semi-Shifting 2 Near Semi-Shifting 2
## 4: Near Semi-Shifting 2 Ashkelon Near Semi-Shifting 2
## 5: Ashkelon Near Semi-Shifting 3 Near Semi-Shifting 3
## ---
## 410: Eshtaol Kkl Plantings 4 Eshtaol 31.78378561_35.02056481
## 411: Eshtaol 31.78694021_35.02193935 Eshtaol Kkl Plantings 3
## 412: Eshtaol Kkl Plantings 3 Eshtaol 31.78694021_35.02193935
## 413: Eshtaol 31.79075347_35.01995897 Eshtaol Kkl Plantings 1
## 414: Eshtaol Kkl Plantings 1 Eshtaol 31.79075347_35.01995897
## conc_lat_lon distance_m unit site
## 1: 31.70919784_34.60432269 0.0000000 Coastal Plain Sands Ashkelon
## 2: 31.70919784_34.60432269 0.0000000 Coastal Plain Sands Ashkelon
## 3: 31.73060424_34.62138511 0.0000000 Coastal Plain Sands Ashkelon
## 4: 31.73060424_34.62138511 0.0000000 Coastal Plain Sands Ashkelon
## 5: 31.73423081_34.61718501 0.0000000 Coastal Plain Sands Ashkelon
## ---
## 410: 31.78378561_35.02056481 0.6849177 Planted Conifer Forests Eshtaol
## 411: 31.78693565_35.02194425 0.6867263 Planted Conifer Forests Eshtaol
## 412: 31.78694021_35.02193935 0.6867263 Planted Conifer Forests Eshtaol
## 413: 31.79075347_35.01995897 0.0000000 Planted Conifer Forests Eshtaol
## 414: 31.79075347_35.01995897 0.0000000 Planted Conifer Forests Eshtaol
## subunit.x habitat.x settlements.x dunes.x mean.lat mean.lon
## 1: <NA> <NA> Near semi-shifting 31.70920 34.60432
## 2: <NA> <NA> Near semi-shifting 31.70920 34.60432
## 3: <NA> <NA> Near semi-shifting 31.73060 34.62139
## 4: <NA> <NA> Near semi-shifting 31.73060 34.62139
## 5: <NA> <NA> Near semi-shifting 31.73423 34.61719
## ---
## 410: Judean Highlands <NA> <NA> <NA> 31.78379 35.02056
## 411: Judean Highlands <NA> <NA> <NA> 31.78694 35.02194
## 412: Judean Highlands <NA> <NA> <NA> 31.78694 35.02194
## 413: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## 414: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## subunit.y habitat.y settlements.y dunes.y
## 1: <NA> <NA> Near semi-shifting
## 2: <NA> <NA> Near semi-shifting
## 3: <NA> <NA> Near semi-shifting
## 4: <NA> <NA> Near semi-shifting
## 5: <NA> <NA> Near semi-shifting
## ---
## 410: Judean Highlands <NA> <NA> <NA>
## 411: Judean Highlands <NA> <NA> <NA>
## 412: Judean Highlands <NA> <NA> <NA>
## 413: Judean Highlands <NA> <NA> <NA>
## 414: Judean Highlands <NA> <NA> <NA>
names(plot.distances.same.att) <- gsub('.x', '', names(plot.distances.same.att))
plot.distances.same.att[, ':=' (subunit.y = NULL, habitat.y = NULL, settlements.y = NULL, dunes.y = NULL)]
names(plot.distances.same.att)
## [1] "distance_to_plot" "plot" "conc_lat_lon" "distance_m"
## [5] "unit" "site" "subunit" "habitat"
## [9] "settlements" "dunes" "mean.lat" "mean.lon"
plot.distances.same.att[, new_plot_id := ifelse(distance_m < 5, distance_to_plot, plot)] # If the distance between plots is less than 5 meters, take the name of the plot to which the distance was measured
plot.distances.same.att[new_plot_id == plot, .N] # 1702 cases
## [1] 1702
plot.distances.same.att[new_plot_id == distance_to_plot, .N] # 434 cases
## [1] 434
plot.distances.same.att
## distance_to_plot plot
## 1: Netiv Haasara Far Semi-Shifting 3 Netiv Haasara Far Semi-Shifting 2
## 2: Netiv Haasara Far Semi-Shifting 1 Netiv Haasara Far Semi-Shifting 2
## 3: Netiv Haasara Far Semi-Shifting 2 Netiv Haasara Far Semi-Shifting 3
## 4: Netiv Haasara Far Semi-Shifting 1 Netiv Haasara Far Semi-Shifting 3
## 5: Netiv Haasara Far Semi-Shifting 3 Netiv Haasara Far Semi-Shifting 1
## ---
## 2132: Eshtaol Kkl Plantings 3 Eshtaol Kkl Plantings 1
## 2133: Eshtaol 31.78378561_35.02056481 Eshtaol 31.79075347_35.01995897
## 2134: Eshtaol 31.78378561_35.02056481 Eshtaol Kkl Plantings 1
## 2135: Eshtaol Kkl Plantings 4 Eshtaol 31.79075347_35.01995897
## 2136: Eshtaol Kkl Plantings 4 Eshtaol Kkl Plantings 1
## conc_lat_lon distance_m unit site
## 1: 31.58659519_34.52004388 734.8819 Coastal Plain Sands Netiv Haasara
## 2: 31.58659519_34.52004388 1802.1413 Coastal Plain Sands Netiv Haasara
## 3: 31.5903723_34.51367732 734.8819 Coastal Plain Sands Netiv Haasara
## 4: 31.5903723_34.51367732 1076.3775 Coastal Plain Sands Netiv Haasara
## 5: 31.59417601_34.50322713 1076.3775 Coastal Plain Sands Netiv Haasara
## ---
## 2132: 31.79075347_35.01995897 464.1424 Planted Conifer Forests Eshtaol
## 2133: 31.79075347_35.01995897 776.9050 Planted Conifer Forests Eshtaol
## 2134: 31.79075347_35.01995897 776.9050 Planted Conifer Forests Eshtaol
## 2135: 31.79075347_35.01995897 777.4417 Planted Conifer Forests Eshtaol
## 2136: 31.79075347_35.01995897 777.4417 Planted Conifer Forests Eshtaol
## subunit habitat settlements dunes mean.lat mean.lon
## 1: <NA> <NA> Far semi-shifting 31.58660 34.52004
## 2: <NA> <NA> Far semi-shifting 31.58660 34.52004
## 3: <NA> <NA> Far semi-shifting 31.59037 34.51368
## 4: <NA> <NA> Far semi-shifting 31.59037 34.51368
## 5: <NA> <NA> Far semi-shifting 31.59418 34.50323
## ---
## 2132: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## 2133: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## 2134: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## 2135: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## 2136: Judean Highlands <NA> <NA> <NA> 31.79075 35.01996
## new_plot_id
## 1: Netiv Haasara Far Semi-Shifting 2
## 2: Netiv Haasara Far Semi-Shifting 2
## 3: Netiv Haasara Far Semi-Shifting 3
## 4: Netiv Haasara Far Semi-Shifting 3
## 5: Netiv Haasara Far Semi-Shifting 1
## ---
## 2132: Eshtaol Kkl Plantings 1
## 2133: Eshtaol 31.79075347_35.01995897
## 2134: Eshtaol Kkl Plantings 1
## 2135: Eshtaol 31.79075347_35.01995897
## 2136: Eshtaol Kkl Plantings 1
write_excel_csv(plot.distances.same.att, file = 'Analysis/Distances between plots in the same site.csv')
# Create a table of pairs of plot codes which are synonyms (same attributes, less than 5 meters apart):
setorder(plot.distances.same.att, plot, distance_m, conc_lat_lon) # sort by distance and plot name
plot.synonyms <- plot.distances.same.att[distance_m < 5, .(new_conc_lat_lon = first(conc_lat_lon)),
keyby = .(site, plot)] # use the first (southernmost) plot ID as the ID for the pair
plot.synonyms <- merge(plot.synonyms, plot.distances.same.att[, .(new_plot_id = first(plot)), keyby = .(new_conc_lat_lon = conc_lat_lon)],
by = c('new_conc_lat_lon'), all.x = T) # add the new plot name per coordinates
plot.synonyms[, .(conc_lat_lon = new_conc_lat_lon, new_plot_id)]
## conc_lat_lon new_plot_id
## 1: 31.21706343_34.57620702 Park Loess Loess 31.21706343_34.57620702
## 2: 31.21706506_34.57621669 Park Loess Loess 2
## 3: 31.21706506_34.57621669 Park Loess Loess 2
## 4: 31.22728013_34.60140018 Park Loess Loess 31.22728013_34.60140018
## 5: 31.22728165_34.60140959 Park Loess Loess 3
## ---
## 244: 33.17319043_35.55108604 Manara Kkl Plantings 2
## 245: 33.17320998_35.5510869 Manara 33.17320998_35.5510869
## 246: 33.18276851_35.54829503 Manara 33.18276851_35.54829503
## 247: 33.18276851_35.54829503 Manara 33.18276851_35.54829503
## 248: 33.18278817_35.54829586 Manara 33.18278817_35.54829586
plot.synonyms <- unique(plot.synonyms)
setcolorder(plot.synonyms, c('plot', 'new_conc_lat_lon', 'new_plot_id'))
plot.synonyms
## plot new_conc_lat_lon
## 1: Park Loess Loess 31.21706343_34.57620702 31.21706343_34.57620702
## 2: Park Loess Loess 2 31.21706506_34.57621669
## 3: Park Loess Loess 31.21706506_34.57621669 31.21706506_34.57621669
## 4: Park Loess Loess 31.22728013_34.60140018 31.22728013_34.60140018
## 5: Park Loess Loess 3 31.22728165_34.60140959
## ---
## 244: Manara Kkl Plantings 2 33.17319043_35.55108604
## 245: Manara 33.17320998_35.5510869 33.17320998_35.5510869
## 246: Manara 33.18276851_35.54829503 33.18276851_35.54829503
## 247: Manara Kkl Plantings 1 33.18276851_35.54829503
## 248: Manara 33.18278817_35.54829586 33.18278817_35.54829586
## new_plot_id site
## 1: Park Loess Loess 31.21706343_34.57620702 Park Loess
## 2: Park Loess Loess 2 Park Loess
## 3: Park Loess Loess 2 Park Loess
## 4: Park Loess Loess 31.22728013_34.60140018 Park Loess
## 5: Park Loess Loess 3 Park Loess
## ---
## 244: Manara Kkl Plantings 2 Manara
## 245: Manara 33.17320998_35.5510869 Manara
## 246: Manara 33.18276851_35.54829503 Manara
## 247: Manara 33.18276851_35.54829503 Manara
## 248: Manara 33.18278817_35.54829586 Manara
setorder(plot.synonyms, plot, new_plot_id)
# plot.synonyms <- plot.synonyms[(new_plot_id %like% '_' & plot %like% '_') | !new_plot_id %like% '_'] # remove cases where the new plot ID would include the coordinates, except when the alternative is to lose the synonimity altogether
plot.synonyms[, .(no.of.new_plot_ids = uniqueN(new_conc_lat_lon)), keyby = plot][no.of.new_plot_ids != 1] # only one conc_lat_lon per plot now
## Empty data.table (0 rows and 2 cols): plot,no.of.new_plot_ids
setorder(plot.synonyms, plot, new_conc_lat_lon)
plot.synonyms[, uniqueN(plot)] # 248 synonimized plots
## [1] 248
bla <- plot.distances.same.att[, .(new_plot_id = unique(plot)), keyby = conc_lat_lon] # list all the synonyms per coordinate pair
multi.new.plot.ids <- bla[, .(no.of.new.plot.ids = uniqueN(new_plot_id)), keyby = conc_lat_lon][no.of.new.plot.ids > 1, conc_lat_lon]
bla[conc_lat_lon %in% multi.new.plot.ids, new_plot_id := first(new_plot_id), by = conc_lat_lon]
bla <- unique(bla)
# plot.synonyms <- merge(plot.synonyms, bla, by.x = 'new_conc_lat_lon', by.y = 'conc_lat_lon', all.x = T)
setorder(plot.synonyms, plot, new_plot_id)
plot.synonyms[, new_plot_id := first(new_plot_id), by = plot]
plot.synonyms <- unique(plot.synonyms[, .(plot, new_plot_id)])
plot.synonyms[, .(no.of.new.plot.ids = uniqueN(new_plot_id)), keyby = plot][no.of.new.plot.ids > 1] # should be an empty data.table
## Empty data.table (0 rows and 2 cols): plot,no.of.new.plot.ids
reptiles <- merge(reptiles, plot.synonyms[, .(point_name = plot, new_plot_id)], by = 'point_name', all.x = T) # add the new plot ID to the reptiles database
reptiles[, uniqueN(point_name)] # 371 plot codes before renaming
## [1] 372
reptiles[!is.na(new_plot_id), point_name := new_plot_id]
reptiles[, uniqueN(point_name)] # now only 289 plot codes
## [1] 290
reptiles[is.na(point_name), .N] # no cases of missing point names
## [1] 0
reptiles[is.na(point_name) & is.na(conc_lat_lon), ] # no cases when both point name and conc_lat_lon are missing
## Empty data.table (0 rows and 56 cols): point_name,site,campaign,year,unit,subunit...
reptiles[is.na(point_name), point_name := conc_lat_lon]
point_names <- reptiles[, .(point_name = unique(point_name)), keyby = site]
point_names <- merge(point_names, reptiles[!is.na(point_name) & !is.na(mean.lat), .(settlements = unique(settlements), habitat = unique(habitat),
agriculture = unique(agriculture), dunes = unique(dunes), mean.lat = unique(mean.lat),
mean.lon = unique(mean.lon)), keyby = 'point_name'], by = 'point_name', all.x = T)
# campaign
reptiles[is.na(campaign), .N, keyby = .(unit, year)] # all missing campaigns are in 2018
## Empty data.table (0 rows and 3 cols): unit,year,N
reptiles[, unique(campaign), keyby = .(unit, year)] # Should be T2
## unit year V1
## 1: Coastal Plain Sands 2014 T0
## 2: Coastal Plain Sands 2015 T1
## 3: Coastal Plain Sands 2017 T2
## 4: Coastal Plain Sands 2019 T3
## 5: Coastal Plain Sands 2021 T4
## 6: Inland Sands 2017 T2
## 7: Inland Sands 2019 T3
## 8: Inland Sands 2021 T4
## 9: Loess Covered Areas in the Northern Negev 2014 T0
## 10: Loess Covered Areas in the Northern Negev 2016 T1
## 11: Loess Covered Areas in the Northern Negev 2018 T2
## 12: Loess Covered Areas in the Northern Negev 2020 T3
## 13: Mediterranean-Desert Transition Zone 2014 T0
## 14: Mediterranean-Desert Transition Zone 2016 T1
## 15: Mediterranean-Desert Transition Zone 2018 T2
## 16: Mediterranean-Desert Transition Zone 2020 T3
## 17: Planted Conifer Forests 2014 T0
## 18: Planted Conifer Forests 2015 T1
## 19: Planted Conifer Forests 2017 T2
## 20: Planted Conifer Forests 2019 T3
## 21: Planted Conifer Forests 2021 T4
## unit year V1
reptiles[is.na(campaign) & year == 2018, campaign := 'T2']
# unit
reptiles[, sort(unique(unit))]
## [1] "Coastal Plain Sands"
## [2] "Inland Sands"
## [3] "Loess Covered Areas in the Northern Negev"
## [4] "Mediterranean-Desert Transition Zone"
## [5] "Planted Conifer Forests"
reptiles[unit == 'Mediterranean Transition Zone', unit := 'Mediterranean-Desert Transition Zone']
# survey ID
reptiles[, survey_ID := paste(campaign, point_name, sep = '_')]
reptiles[, .(no.of.dates = uniqueN(date)), keyby = .(unit, campaign, survey_ID)][no.of.dates > 1] # No fewer than 20 surveys have more than one date, all from T0
## unit campaign survey_ID
## 1: Coastal Plain Sands T0 T0_Ashdod Far Semi-Shifting 1
## 2: Coastal Plain Sands T0 T0_Ashdod Far Semi-Shifting 2
## 3: Coastal Plain Sands T0 T0_Ashdod Far Semi-Shifting 3
## 4: Coastal Plain Sands T0 T0_Ashdod Far Shifting 1
## 5: Coastal Plain Sands T0 T0_Ashdod Far Shifting 2
## 6: Coastal Plain Sands T0 T0_Ashdod Far Shifting 3
## 7: Coastal Plain Sands T0 T0_Ashdod Near Semi-Shifting 1
## 8: Coastal Plain Sands T0 T0_Ashdod Near Semi-Shifting 2
## 9: Coastal Plain Sands T0 T0_Ashdod Near Semi-Shifting 3
## 10: Coastal Plain Sands T0 T0_Ashkelon Far Semi-Shifting 1
## 11: Coastal Plain Sands T0 T0_Ashkelon Far Semi-Shifting 3
## 12: Coastal Plain Sands T0 T0_Ashkelon Far Shifting 1
## 13: Coastal Plain Sands T0 T0_Ashkelon Far Shifting 3
## 14: Coastal Plain Sands T0 T0_Ashkelon Near Semi-Shifting 2
## 15: Coastal Plain Sands T0 T0_Netiv Haasara Far Semi-Shifting 1
## 16: Coastal Plain Sands T0 T0_Netiv Haasara Far Semi-Shifting 2
## 17: Coastal Plain Sands T0 T0_Netiv Haasara Far Shifting 1
## 18: Coastal Plain Sands T0 T0_Netiv Haasara Far Shifting 2
## 19: Coastal Plain Sands T0 T0_Netiv Haasara Far Shifting 3
## 20: Coastal Plain Sands T0 T0_Netiv Haasara Near Semi-Shifting 1
## no.of.dates
## 1: 2
## 2: 2
## 3: 2
## 4: 2
## 5: 2
## 6: 2
## 7: 2
## 8: 2
## 9: 2
## 10: 2
## 11: 2
## 12: 2
## 13: 2
## 14: 2
## 15: 2
## 16: 2
## 17: 2
## 18: 2
## 19: 2
## 20: 2
reptiles[survey_ID %in% reptiles[, .(no.of.dates = uniqueN(date)), keyby = survey_ID][no.of.dates > 1, survey_ID],
.(unit, campaign, site, survey_ID, date)] # All from T0 (2014) coastal plain dunes
## unit campaign site
## 1: Coastal Plain Sands T0 Ashdod
## 2: Coastal Plain Sands T0 Ashdod
## 3: Coastal Plain Sands T0 Ashdod
## 4: Coastal Plain Sands T0 Ashdod
## 5: Coastal Plain Sands T0 Ashdod
## 6: Coastal Plain Sands T0 Ashdod
## 7: Coastal Plain Sands T0 Ashdod
## 8: Coastal Plain Sands T0 Ashdod
## 9: Coastal Plain Sands T0 Ashdod
## 10: Coastal Plain Sands T0 Ashdod
## 11: Coastal Plain Sands T0 Ashdod
## 12: Coastal Plain Sands T0 Ashdod
## 13: Coastal Plain Sands T0 Ashdod
## 14: Coastal Plain Sands T0 Ashdod
## 15: Coastal Plain Sands T0 Ashdod
## 16: Coastal Plain Sands T0 Ashdod
## 17: Coastal Plain Sands T0 Ashdod
## 18: Coastal Plain Sands T0 Ashdod
## 19: Coastal Plain Sands T0 Ashdod
## 20: Coastal Plain Sands T0 Ashdod
## 21: Coastal Plain Sands T0 Ashdod
## 22: Coastal Plain Sands T0 Ashdod
## 23: Coastal Plain Sands T0 Ashdod
## 24: Coastal Plain Sands T0 Ashdod
## 25: Coastal Plain Sands T0 Ashdod
## 26: Coastal Plain Sands T0 Ashdod
## 27: Coastal Plain Sands T0 Ashdod
## 28: Coastal Plain Sands T0 Ashdod
## 29: Coastal Plain Sands T0 Ashdod
## 30: Coastal Plain Sands T0 Ashdod
## 31: Coastal Plain Sands T0 Ashdod
## 32: Coastal Plain Sands T0 Ashdod
## 33: Coastal Plain Sands T0 Ashdod
## 34: Coastal Plain Sands T0 Ashdod
## 35: Coastal Plain Sands T0 Ashdod
## 36: Coastal Plain Sands T0 Ashdod
## 37: Coastal Plain Sands T0 Ashdod
## 38: Coastal Plain Sands T0 Ashdod
## 39: Coastal Plain Sands T0 Ashdod
## 40: Coastal Plain Sands T0 Ashdod
## 41: Coastal Plain Sands T0 Ashdod
## 42: Coastal Plain Sands T0 Ashdod
## 43: Coastal Plain Sands T0 Ashdod
## 44: Coastal Plain Sands T0 Ashkelon
## 45: Coastal Plain Sands T0 Ashkelon
## 46: Coastal Plain Sands T0 Ashkelon
## 47: Coastal Plain Sands T0 Ashkelon
## 48: Coastal Plain Sands T0 Ashkelon
## 49: Coastal Plain Sands T0 Ashkelon
## 50: Coastal Plain Sands T0 Ashkelon
## 51: Coastal Plain Sands T0 Ashkelon
## 52: Coastal Plain Sands T0 Ashkelon
## 53: Coastal Plain Sands T0 Ashkelon
## 54: Coastal Plain Sands T0 Ashkelon
## 55: Coastal Plain Sands T0 Ashkelon
## 56: Coastal Plain Sands T0 Ashkelon
## 57: Coastal Plain Sands T0 Ashkelon
## 58: Coastal Plain Sands T0 Ashkelon
## 59: Coastal Plain Sands T0 Ashkelon
## 60: Coastal Plain Sands T0 Ashkelon
## 61: Coastal Plain Sands T0 Ashkelon
## 62: Coastal Plain Sands T0 Ashkelon
## 63: Coastal Plain Sands T0 Ashkelon
## 64: Coastal Plain Sands T0 Ashkelon
## 65: Coastal Plain Sands T0 Ashkelon
## 66: Coastal Plain Sands T0 Ashkelon
## 67: Coastal Plain Sands T0 Ashkelon
## 68: Coastal Plain Sands T0 Ashkelon
## 69: Coastal Plain Sands T0 Ashkelon
## 70: Coastal Plain Sands T0 Ashkelon
## 71: Coastal Plain Sands T0 Ashkelon
## 72: Coastal Plain Sands T0 Ashkelon
## 73: Coastal Plain Sands T0 Ashkelon
## 74: Coastal Plain Sands T0 Ashkelon
## 75: Coastal Plain Sands T0 Ashkelon
## 76: Coastal Plain Sands T0 Netiv Haasara
## 77: Coastal Plain Sands T0 Netiv Haasara
## 78: Coastal Plain Sands T0 Netiv Haasara
## 79: Coastal Plain Sands T0 Netiv Haasara
## 80: Coastal Plain Sands T0 Netiv Haasara
## 81: Coastal Plain Sands T0 Netiv Haasara
## 82: Coastal Plain Sands T0 Netiv Haasara
## 83: Coastal Plain Sands T0 Netiv Haasara
## 84: Coastal Plain Sands T0 Netiv Haasara
## 85: Coastal Plain Sands T0 Netiv Haasara
## 86: Coastal Plain Sands T0 Netiv Haasara
## 87: Coastal Plain Sands T0 Netiv Haasara
## 88: Coastal Plain Sands T0 Netiv Haasara
## 89: Coastal Plain Sands T0 Netiv Haasara
## 90: Coastal Plain Sands T0 Netiv Haasara
## 91: Coastal Plain Sands T0 Netiv Haasara
## 92: Coastal Plain Sands T0 Netiv Haasara
## 93: Coastal Plain Sands T0 Netiv Haasara
## 94: Coastal Plain Sands T0 Netiv Haasara
## 95: Coastal Plain Sands T0 Netiv Haasara
## 96: Coastal Plain Sands T0 Netiv Haasara
## 97: Coastal Plain Sands T0 Netiv Haasara
## unit campaign site
## survey_ID date
## 1: T0_Ashdod Far Semi-Shifting 1 01/10/2014
## 2: T0_Ashdod Far Semi-Shifting 1 01/10/2014
## 3: T0_Ashdod Far Semi-Shifting 1 30/09/2014
## 4: T0_Ashdod Far Semi-Shifting 1 30/09/2014
## 5: T0_Ashdod Far Semi-Shifting 2 01/10/2014
## 6: T0_Ashdod Far Semi-Shifting 2 01/10/2014
## 7: T0_Ashdod Far Semi-Shifting 2 01/10/2014
## 8: T0_Ashdod Far Semi-Shifting 2 30/09/2014
## 9: T0_Ashdod Far Semi-Shifting 2 30/09/2014
## 10: T0_Ashdod Far Semi-Shifting 2 30/09/2014
## 11: T0_Ashdod Far Semi-Shifting 3 30/09/2014
## 12: T0_Ashdod Far Semi-Shifting 3 01/10/2014
## 13: T0_Ashdod Far Semi-Shifting 3 01/10/2014
## 14: T0_Ashdod Far Semi-Shifting 3 30/09/2014
## 15: T0_Ashdod Far Semi-Shifting 3 30/09/2014
## 16: T0_Ashdod Far Semi-Shifting 3 30/09/2014
## 17: T0_Ashdod Far Shifting 1 01/10/2014
## 18: T0_Ashdod Far Shifting 1 01/10/2014
## 19: T0_Ashdod Far Shifting 1 30/09/2014
## 20: T0_Ashdod Far Shifting 1 30/09/2014
## 21: T0_Ashdod Far Shifting 2 01/10/2014
## 22: T0_Ashdod Far Shifting 2 01/10/2014
## 23: T0_Ashdod Far Shifting 2 30/09/2014
## 24: T0_Ashdod Far Shifting 2 30/09/2014
## 25: T0_Ashdod Far Shifting 2 30/09/2014
## 26: T0_Ashdod Far Shifting 3 30/09/2014
## 27: T0_Ashdod Far Shifting 3 01/10/2014
## 28: T0_Ashdod Far Shifting 3 01/10/2014
## 29: T0_Ashdod Far Shifting 3 01/10/2014
## 30: T0_Ashdod Far Shifting 3 30/09/2014
## 31: T0_Ashdod Far Shifting 3 30/09/2014
## 32: T0_Ashdod Near Semi-Shifting 1 02/10/2014
## 33: T0_Ashdod Near Semi-Shifting 1 02/10/2014
## 34: T0_Ashdod Near Semi-Shifting 1 01/10/2014
## 35: T0_Ashdod Near Semi-Shifting 1 01/10/2014
## 36: T0_Ashdod Near Semi-Shifting 2 02/10/2014
## 37: T0_Ashdod Near Semi-Shifting 2 02/10/2014
## 38: T0_Ashdod Near Semi-Shifting 2 01/10/2014
## 39: T0_Ashdod Near Semi-Shifting 3 02/10/2014
## 40: T0_Ashdod Near Semi-Shifting 3 02/10/2014
## 41: T0_Ashdod Near Semi-Shifting 3 02/10/2014
## 42: T0_Ashdod Near Semi-Shifting 3 01/10/2014
## 43: T0_Ashdod Near Semi-Shifting 3 01/10/2014
## 44: T0_Ashkelon Far Semi-Shifting 1 05/10/2014
## 45: T0_Ashkelon Far Semi-Shifting 1 06/10/2014
## 46: T0_Ashkelon Far Semi-Shifting 1 06/10/2014
## 47: T0_Ashkelon Far Semi-Shifting 1 06/10/2014
## 48: T0_Ashkelon Far Semi-Shifting 1 06/10/2014
## 49: T0_Ashkelon Far Semi-Shifting 1 05/10/2014
## 50: T0_Ashkelon Far Semi-Shifting 1 05/10/2014
## 51: T0_Ashkelon Far Semi-Shifting 1 05/10/2014
## 52: T0_Ashkelon Far Semi-Shifting 3 06/10/2014
## 53: T0_Ashkelon Far Semi-Shifting 3 06/10/2014
## 54: T0_Ashkelon Far Semi-Shifting 3 06/10/2014
## 55: T0_Ashkelon Far Semi-Shifting 3 05/10/2014
## 56: T0_Ashkelon Far Shifting 1 06/10/2014
## 57: T0_Ashkelon Far Shifting 1 06/10/2014
## 58: T0_Ashkelon Far Shifting 1 06/10/2014
## 59: T0_Ashkelon Far Shifting 1 06/10/2014
## 60: T0_Ashkelon Far Shifting 1 05/10/2014
## 61: T0_Ashkelon Far Shifting 3 06/10/2014
## 62: T0_Ashkelon Far Shifting 3 06/10/2014
## 63: T0_Ashkelon Far Shifting 3 06/10/2014
## 64: T0_Ashkelon Far Shifting 3 05/10/2014
## 65: T0_Ashkelon Far Shifting 3 05/10/2014
## 66: T0_Ashkelon Near Semi-Shifting 2 02/10/2014
## 67: T0_Ashkelon Near Semi-Shifting 2 02/10/2014
## 68: T0_Ashkelon Near Semi-Shifting 2 02/10/2014
## 69: T0_Ashkelon Near Semi-Shifting 2 01/10/2014
## 70: T0_Ashkelon Near Semi-Shifting 2 01/10/2014
## 71: T0_Ashkelon Near Semi-Shifting 2 01/10/2014
## 72: T0_Ashkelon Near Semi-Shifting 2 01/10/2014
## 73: T0_Ashkelon Near Semi-Shifting 2 01/10/2014
## 74: T0_Ashkelon Near Semi-Shifting 2 01/10/2014
## 75: T0_Ashkelon Near Semi-Shifting 2 01/10/2014
## 76: T0_Netiv Haasara Far Semi-Shifting 1 14/10/2014
## 77: T0_Netiv Haasara Far Semi-Shifting 1 14/10/2014
## 78: T0_Netiv Haasara Far Semi-Shifting 1 13/10/2014
## 79: T0_Netiv Haasara Far Semi-Shifting 2 14/10/2014
## 80: T0_Netiv Haasara Far Semi-Shifting 2 14/10/2014
## 81: T0_Netiv Haasara Far Semi-Shifting 2 14/10/2014
## 82: T0_Netiv Haasara Far Semi-Shifting 2 13/10/2014
## 83: T0_Netiv Haasara Far Semi-Shifting 2 13/10/2014
## 84: T0_Netiv Haasara Far Semi-Shifting 2 13/10/2014
## 85: T0_Netiv Haasara Far Shifting 1 14/10/2014
## 86: T0_Netiv Haasara Far Shifting 1 14/10/2014
## 87: T0_Netiv Haasara Far Shifting 1 13/10/2014
## 88: T0_Netiv Haasara Far Shifting 2 14/10/2014
## 89: T0_Netiv Haasara Far Shifting 2 13/10/2014
## 90: T0_Netiv Haasara Far Shifting 2 13/10/2014
## 91: T0_Netiv Haasara Far Shifting 3 14/10/2014
## 92: T0_Netiv Haasara Far Shifting 3 14/10/2014
## 93: T0_Netiv Haasara Far Shifting 3 13/10/2014
## 94: T0_Netiv Haasara Far Shifting 3 13/10/2014
## 95: T0_Netiv Haasara Near Semi-Shifting 1 14/10/2014
## 96: T0_Netiv Haasara Near Semi-Shifting 1 14/10/2014
## 97: T0_Netiv Haasara Near Semi-Shifting 1 13/10/2014
## survey_ID date
# These cases are all one day apart, luckily. We will arbitrarily take the first date of each
reptiles[, .(Date = min(date)), keyby = survey_ID]
## survey_ID Date
## 1: T0_Aderet 31.67145208_34.98801954 24/09/2014
## 2: T0_Aderet 31.67578059_34.98668299 24/09/2014
## 3: T0_Aderet 31.67867469_34.98154177 <NA>
## 4: T0_Amatzia 31.50752022_34.89495214 31/08/2014
## 5: T0_Amatzia 31.51244878_34.8934848 31/08/2014
## ---
## 694: T4_Zikim Near Semi-Shifting 2 10/09/2021
## 695: T4_Zikim Near Semi-Shifting 3 10/09/2021
## 696: T4_Zuriel 33.01091098_35.31488335 23/06/2021
## 697: T4_Zuriel 33.01398017_35.31735242 <NA>
## 698: T4_Zuriel Kkl Plantings 1a <NA>
reptiles[, .(no.of.surveys = uniqueN(survey_ID))] # 698 surveys overall
## no.of.surveys
## 1: 698
reptiles[count_individuals > 0, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit)] # only surveys where at least one reptile was found
## unit no.of.surveys
## 1: Coastal Plain Sands 170
## 2: Inland Sands 72
## 3: Loess Covered Areas in the Northern Negev 98
## 4: Mediterranean-Desert Transition Zone 115
## 5: Planted Conifer Forests 176
reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit)]
## unit no.of.surveys
## 1: Coastal Plain Sands 170
## 2: Inland Sands 72
## 3: Loess Covered Areas in the Northern Negev 113
## 4: Mediterranean-Desert Transition Zone 119
## 5: Planted Conifer Forests 224
reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit, campaign, year)]
## unit campaign year no.of.surveys
## 1: Coastal Plain Sands T0 2014 27
## 2: Coastal Plain Sands T1 2015 36
## 3: Coastal Plain Sands T2 2017 36
## 4: Coastal Plain Sands T3 2019 35
## 5: Coastal Plain Sands T4 2021 36
## 6: Inland Sands T2 2017 24
## 7: Inland Sands T3 2019 24
## 8: Inland Sands T4 2021 24
## 9: Loess Covered Areas in the Northern Negev T0 2014 28
## 10: Loess Covered Areas in the Northern Negev T1 2016 30
## 11: Loess Covered Areas in the Northern Negev T2 2018 28
## 12: Loess Covered Areas in the Northern Negev T3 2020 27
## 13: Mediterranean-Desert Transition Zone T0 2014 30
## 14: Mediterranean-Desert Transition Zone T1 2016 29
## 15: Mediterranean-Desert Transition Zone T2 2018 30
## 16: Mediterranean-Desert Transition Zone T3 2020 30
## 17: Planted Conifer Forests T0 2014 45
## 18: Planted Conifer Forests T1 2015 44
## 19: Planted Conifer Forests T2 2017 45
## 20: Planted Conifer Forests T3 2019 45
## 21: Planted Conifer Forests T4 2021 45
## unit campaign year no.of.surveys
reptiles[, sort(unique(settlements)), keyby = unit] # this is only meaningful in the coastal plain and semi desert
## unit V1
## 1: Coastal Plain Sands Far
## 2: Coastal Plain Sands Near
## 3: Mediterranean-Desert Transition Zone Far
## 4: Mediterranean-Desert Transition Zone Near
reptiles[unit %like% 'Forest', settlements := NA]
reptiles[, sort(unique(habitat))]
## [1] "bedouin agriculture" "kkl plantings" "loess"
reptiles[habitat %like% 'agri', habitat := "bedouin agriculture"]
plot.surveyed <- reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit, campaign, year, site, habitat, dunes, agriculture, settlements)]
plot.surveyed[no.of.surveys != 3]
## unit campaign year site
## 1: Coastal Plain Sands T3 2019 Caesarea
## 2: Loess Covered Areas in the Northern Negev T0 2014 Nahal Ashan
## 3: Loess Covered Areas in the Northern Negev T2 2018 Eshel Hanasi
## 4: Loess Covered Areas in the Northern Negev T2 2018 Givot Bar
## 5: Loess Covered Areas in the Northern Negev T3 2020 Eshel Hanasi
## 6: Loess Covered Areas in the Northern Negev T3 2020 Givot Bar
## 7: Mediterranean-Desert Transition Zone T1 2016 Mirsham
## 8: Planted Conifer Forests T1 2015 Kerem Maharal
## 9: Planted Conifer Forests T1 2015 Ofer
## 10: Planted Conifer Forests T1 2015 Ramat Hashofet
## habitat dunes agriculture settlements no.of.surveys
## 1: <NA> semi-shifting <NA> Near 2
## 2: kkl plantings <NA> <NA> <NA> 4
## 3: bedouin agriculture <NA> <NA> <NA> 2
## 4: bedouin agriculture <NA> <NA> <NA> 2
## 5: bedouin agriculture <NA> <NA> <NA> 2
## 6: bedouin agriculture <NA> <NA> <NA> 1
## 7: <NA> <NA> <NA> Near 2
## 8: <NA> <NA> <NA> <NA> 2
## 9: <NA> <NA> <NA> <NA> 4
## 10: <NA> <NA> <NA> <NA> 2
plot.surveyed
## unit campaign year site habitat dunes
## 1: Coastal Plain Sands T0 2014 Ashdod <NA> semi-shifting
## 2: Coastal Plain Sands T0 2014 Ashdod <NA> semi-shifting
## 3: Coastal Plain Sands T0 2014 Ashdod <NA> shifting
## 4: Coastal Plain Sands T0 2014 Ashkelon <NA> semi-shifting
## 5: Coastal Plain Sands T0 2014 Ashkelon <NA> semi-shifting
## ---
## 231: Planted Conifer Forests T4 2021 Meron <NA> <NA>
## 232: Planted Conifer Forests T4 2021 Ofer <NA> <NA>
## 233: Planted Conifer Forests T4 2021 Ramat Hashofet <NA> <NA>
## 234: Planted Conifer Forests T4 2021 Ramot Naftali <NA> <NA>
## 235: Planted Conifer Forests T4 2021 Zuriel <NA> <NA>
## agriculture settlements no.of.surveys
## 1: <NA> Far 3
## 2: <NA> Near 3
## 3: <NA> Far 3
## 4: <NA> Far 3
## 5: <NA> Near 3
## ---
## 231: <NA> <NA> 3
## 232: <NA> <NA> 3
## 233: <NA> <NA> 3
## 234: <NA> <NA> 3
## 235: <NA> <NA> 3
merge(plot.surveyed, data.table(expand.grid(site = reptiles[, unique(site)], campaign = c('T0', 'T1', 'T2', 'T3', 'T4'))),
by = c('site', 'campaign'), all.x = T)[is.na(no.of.surveys)] # empty data.table -> all sites were surveyed at least once per campaign
## Empty data.table (0 rows and 9 cols): site,campaign,unit,year,habitat,dunes...
write_excel_csv(plot.surveyed, 'Analysis/No. of plots surveyed breakdown 29.1.2024.csv')
# 4 plots in Lehavim in 2014 (should be only 3):
reptiles[site %like% 'Lehavim' & year == 2014, .(Date, ITime, SciName, count_individuals), keyby = .(campaign, settlements, point_name)]
## campaign settlements point_name Date ITime
## 1: T0 Far Lehavim Far 1 2014-04-24 15:00:00
## 2: T0 Far Lehavim Far 31.3350892_34.83998961 2014-04-24 13:15:00
## 3: T0 Far Lehavim Far 31.3350892_34.83998961 2014-04-24 13:17:00
## 4: T0 Far Lehavim Far 31.35798817_34.84029091 2014-04-24 11:49:00
## 5: T0 Far Lehavim Far 31.35798817_34.84029091 2014-04-24 11:56:00
## 6: T0 Far Lehavim Far 31.35798817_34.84029091 2014-04-24 12:05:00
## 7: T0 Near Lehavim Near 12 2014-06-26 17:15:00
## 8: T0 Near Lehavim Near 31.3659832_34.82239692 2014-06-26 15:57:00
## 9: T0 Near Lehavim Near 6 2014-04-24 10:23:00
## SciName count_individuals
## 1: <NA> 0
## 2: Chalcides guentheri 1
## 3: Chalcides ocellatus 1
## 4: Heremites vittatus 1
## 5: Hemidactylus turcicus 1
## 6: Eumeces schneiderii 1
## 7: <NA> 0
## 8: Ophisops elegans 1
## 9: Laudakia vulgaris 1
reptiles[point_name == 'Lehavim Near 31.3659832_34.82239692', point_name := 'Lehavim Near 11']
# 4 plots in KKL plantings in Nahal Ashan in 2014 (should be only 3):
reptiles[campaign == 'T0' & site %like% 'Ashan', .(unique(point_name)), keyby = .(Date, habitat)] # 31.2826508607692_34.7486309384615 is the same as 31.28265003_34.74862372
## Date habitat V1
## 1: 2014-06-23 kkl plantings Nahal Ashan Kkl Plantings 2
## 2: 2014-06-23 kkl plantings Nahal Ashan Kkl Plantings 31.28265003_34.74862372
## 3: 2014-06-23 kkl plantings Nahal Ashan Kkl Plantings 31.28684679_34.74364408
## 4: 2014-06-23 kkl plantings Nahal Ashan Kkl Plantings 31.29349178_34.74750308
## 5: 2014-06-23 loess Nahal Ashan Loess 31.28245503_34.75764806
## 6: 2014-06-23 loess Nahal Ashan Loess 31.29271253_34.76700752
## 7: 2014-06-23 loess Nahal Ashan Loess 31.29436508_34.77658303
# We use the original excel file from 2014 to correctly assign observations to plots. Nahal Ashan kkl 1 had only one Chalcides ocellatus and nothing else:
reptiles[campaign == 'T0' & site %like% 'Ashan', .(SciName), keyby = .(Date, ITime, point_name, habitat)]
## Date ITime point_name
## 1: 2014-06-23 09:03:00 Nahal Ashan Loess 31.28245503_34.75764806
## 2: 2014-06-23 09:07:00 Nahal Ashan Loess 31.28245503_34.75764806
## 3: 2014-06-23 09:14:00 Nahal Ashan Loess 31.28245503_34.75764806
## 4: 2014-06-23 09:16:00 Nahal Ashan Loess 31.28245503_34.75764806
## 5: 2014-06-23 09:20:00 Nahal Ashan Loess 31.28245503_34.75764806
## 6: 2014-06-23 09:45:00 Nahal Ashan Loess 31.29271253_34.76700752
## 7: 2014-06-23 09:59:00 Nahal Ashan Loess 31.29271253_34.76700752
## 8: 2014-06-23 10:39:00 Nahal Ashan Loess 31.29436508_34.77658303
## 9: 2014-06-23 10:39:00 Nahal Ashan Loess 31.29436508_34.77658303
## 10: 2014-06-23 11:35:00 Nahal Ashan Kkl Plantings 31.28265003_34.74862372
## 11: 2014-06-23 11:36:00 Nahal Ashan Kkl Plantings 31.28265003_34.74862372
## 12: 2014-06-23 11:36:00 Nahal Ashan Kkl Plantings 31.28265003_34.74862372
## 13: 2014-06-23 11:38:00 Nahal Ashan Kkl Plantings 2
## 14: 2014-06-23 12:09:00 Nahal Ashan Kkl Plantings 31.28684679_34.74364408
## 15: 2014-06-23 13:01:00 Nahal Ashan Kkl Plantings 31.29349178_34.74750308
## habitat SciName
## 1: loess Ophisops elegans
## 2: loess Ophisops elegans
## 3: loess Chalcides ocellatus
## 4: loess Chalcides ocellatus
## 5: loess Eumeces schneiderii
## 6: loess Ptyodactylus guttatus
## 7: loess Chalcides ocellatus
## 8: loess Mesalina guttulata
## 9: loess Chalcides ocellatus
## 10: kkl plantings Chamaeleo chamaeleon
## 11: kkl plantings Stellagama stellio
## 12: kkl plantings Chalcides ocellatus
## 13: kkl plantings Hemidactylus turcicus
## 14: kkl plantings Chalcides ocellatus
## 15: kkl plantings Mesalina guttulata
# Nahal Ashan Kkl Plantings 31.28265003_34.74862372 = Nahal Ashan Kkl Plantings 2;
# Nahal Ashan Kkl Plantings 31.28684679_34.74364408 = Nahal Ashan Kkl Plantings 1;
# Nahal Ashan Kkl Plantings 31.29349178_34.74750308 = Nahal Ashan Kkl Plantings 3
reptiles[point_name == 'Nahal Ashan Kkl Plantings 31.28265003_34.74862372', point_name := 'Nahal Ashan Kkl Plantings 2']
reptiles[point_name == 'Nahal Ashan Kkl Plantings 31.28684679_34.74364408', point_name := 'Nahal Ashan Kkl Plantings 1']
reptiles[point_name == 'Nahal Ashan Kkl Plantings 31.29349178_34.74750308', point_name := 'Nahal Ashan Kkl Plantings 3']
reptiles[unit %like% 'Loess' & campaign == 'T0' & site %like% 'Ashan', .(unique(point_name)), keyby = .(Date, habitat)] # now only 3 plots, as expected
## Date habitat V1
## 1: 2014-06-23 kkl plantings Nahal Ashan Kkl Plantings 2
## 2: 2014-06-23 kkl plantings Nahal Ashan Kkl Plantings 1
## 3: 2014-06-23 kkl plantings Nahal Ashan Kkl Plantings 3
## 4: 2014-06-23 loess Nahal Ashan Loess 31.28245503_34.75764806
## 5: 2014-06-23 loess Nahal Ashan Loess 31.29271253_34.76700752
## 6: 2014-06-23 loess Nahal Ashan Loess 31.29436508_34.77658303
# 4 plots in KKL plantings in Nahal Ashan in 2018 (should be only 3):
reptiles[unit %like% 'Loess' & campaign == 'T2' & site %like% 'Ashan', .(total.obs = sum(count_individuals)),
keyby = .(Date, habitat, point_name)] # Only 3 plots per habitat, as expected, but one plot has zero observations (Nahal Ashan Loess 2)
## Date habitat point_name total.obs
## 1: 2018-04-30 loess Nahal Ashan Loess 1 2
## 2: 2018-04-30 loess Nahal Ashan Loess 2 0
## 3: 2018-04-30 loess Nahal Ashan Loess 3 4
## 4: 2018-05-08 kkl plantings Nahal Ashan Kkl Plantings 1 2
## 5: 2018-05-08 kkl plantings Nahal Ashan Kkl Plantings 2 9
## 6: 2018-05-08 kkl plantings Nahal Ashan Kkl Plantings 3 2
# only 2 plots in Aderet in T0 - why?
reptiles[site %like% 'Aderet' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Aderet plots were surveyed:
## Date ITime point_name SciName
## 1: 2014-09-24 09:34:00 Aderet 31.67145208_34.98801954 Hemidactylus turcicus
## 2: 2014-09-24 09:39:00 Aderet 31.67145208_34.98801954 Stellagama stellio
## 3: 2014-09-24 09:45:00 Aderet 31.67867469_34.98154177 <NA>
## 4: 2014-09-24 10:26:00 Aderet 31.67578059_34.98668299 Phoenicolacerta laevis
## 5: 2014-09-24 10:32:00 Aderet 31.67578059_34.98668299 Hemidactylus turcicus
## count_individuals
## 1: 1
## 2: 1
## 3: 0
## 4: 1
## 5: 1
# Aderet 31.67145208_34.98801954 = Aderet Kkl 3; Aderet 31.67578059_34.98668299 = Aderet Kkl 2
reptiles[point_name == 'Aderet 31.67145208_34.98801954', point_name := 'Aderet Kkl 3']
reptiles[point_name == 'Aderet 31.67578059_34.98668299', point_name := 'Aderet Kkl 2']
# Only 1 plot in Bat Shlomo in T0 - why?
reptiles[site %like% 'Bat Shlomo' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Bat Shlomo plots were surveyed:
## Date ITime point_name SciName
## 1: 2014-07-30 09:25:00 Bat Shlomo 32.58718195_35.01053736 Hemidactylus turcicus
## 2: 2014-07-30 09:29:00 Bat Shlomo 32.58718195_35.01053736 Hemidactylus turcicus
## 3: 2014-07-30 09:30:00 Bat Shlomo 32.58718195_35.01053736 Hemidactylus turcicus
## 4: 2014-07-30 10:53:00 Bat Shlomo Far 2 <NA>
## 5: 2014-07-30 11:20:00 Bat Shlomo Far 1 <NA>
## count_individuals
## 1: 1
## 2: 1
## 3: 1
## 4: 0
## 5: 0
reptiles[point_name == 'Bat Shlomo 32.58718195_35.01053736', point_name := 'Bat Shlomo Kkl 3']
# Only 1 plot in Eutanim in T0 - why?
reptiles[site %like% 'Eitanim' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Eitanim plots were surveyed:
## Date ITime point_name SciName
## 1: 2014-08-11 10:33:00 Eitanim 31.77909156_35.10359697 Ablepharus rueppellii
## 2: 2014-08-11 10:45:00 Eitanim Far 3 <NA>
## 3: 2014-08-11 11:50:00 Eitanim Far 1 <NA>
## count_individuals
## 1: 1
## 2: 0
## 3: 0
reptiles[point_name == 'Eitanim 31.77909156_35.10359697', point_name := 'Eitanim Kkl 2']
# Only 2 plots in Eshtaol in T0 - why?
reptiles[site %like% 'Eshtaol' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Eshtaol plots were surveyed:
## Date ITime point_name SciName
## 1: 2014-08-10 09:32:00 Eshtaol 31.78378561_35.02056481 Hemidactylus turcicus
## 2: 2014-08-10 10:19:00 Eshtaol 31.78694021_35.02193935 Ablepharus rueppellii
## 3: 2014-08-10 11:58:00 Eshtaol Far 1 <NA>
## count_individuals
## 1: 1
## 2: 1
## 3: 0
reptiles[point_name == 'Eshtaol 31.78378561_35.02056481', point_name := 'Eshtaol Kkl 4']
reptiles[point_name == 'Eshtaol 31.78694021_35.02193935', point_name := 'Eshtaol Kkl 3']
# Only 2 plots in Givat Yeshayahu in T0 - why?
reptiles[site %like% 'Yeshayahu' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Givat Yeshayahu plots were surveyed:
## Date ITime point_name
## 1: 2014-08-31 12:47:00 Givat Yeshayahu 31.66774825_34.92543564
## 2: 2014-08-31 12:57:00 Givat Yeshayahu 31.66774825_34.92543564
## 3: 2014-08-31 13:24:00 Givat Yeshayahu 31.66540534_34.91739057
## 4: 2014-08-31 14:40:00 Givat Yeshayahu Far 1
## SciName count_individuals
## 1: Hemidactylus turcicus 1
## 2: Testudo graeca 1
## 3: Hemidactylus turcicus 1
## 4: <NA> 0
reptiles[point_name == 'Givat Yeshayahu 31.66774825_34.92543564', point_name := 'Givat Yeshayahu 3']
reptiles[point_name == 'Givat Yeshayahu 31.66540534_34.91739057', point_name := 'Givat Yeshayahu 2']
# Only 2 plots in Kerem Maharal in T0 - why?
reptiles[site %like% 'Maharal' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Kerem Maharal plots were surveyed:
## Date ITime point_name
## 1: 2014-09-01 09:27:00 Kerem Maharal 32.61292488_34.96995645
## 2: 2014-09-01 09:30:00 Kerem Maharal 32.61292488_34.96995645
## 3: 2014-09-01 09:32:00 Kerem Maharal 32.61292488_34.96995645
## 4: 2014-09-01 09:34:00 Kerem Maharal 32.61292488_34.96995645
## 5: 2014-09-01 09:42:00 Kerem Maharal Kkl Plantings 2
## 6: 2014-09-01 10:08:00 Kerem Maharal 32.61228912_34.96368208
## SciName count_individuals
## 1: Ablepharus rueppellii 1
## 2: Ablepharus rueppellii 1
## 3: Ablepharus rueppellii 1
## 4: Platyceps collaris 1
## 5: <NA> 0
## 6: Hemidactylus turcicus 1
reptiles[point_name == 'Kerem Maharal 32.61292488_34.96995645', point_name := 'Kerem Maharal Kkl 1']
reptiles[point_name == 'Kerem Maharal 32.61228912_34.96368208', point_name := 'Kerem Maharal Kkl 3']
# Only 2 plots in Manara in T0 - why?
reptiles[site %like% 'Manara' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Manara plots were surveyed:
## Date ITime point_name SciName
## 1: 2014-08-05 09:59:00 Manara 33.17320998_35.5510869 Ablepharus rueppellii
## 2: 2014-08-05 10:12:00 Manara 33.17320998_35.5510869 Ablepharus rueppellii
## 3: 2014-08-05 11:50:00 Manara Kkl Plantings 3 <NA>
## 4: 2014-08-05 12:00:00 Manara 33.18278817_35.54829586 Ophisops elegans
## count_individuals
## 1: 1
## 2: 1
## 3: 0
## 4: 1
reptiles[point_name == 'Manara 33.17320998_35.5510869', point_name := 'Manara Kkl 2']
reptiles[point_name == 'Manara 33.18278817_35.54829586', point_name := 'Manara Kkl 1']
# Only 2 plots in Ofer in T0 - why?
reptiles[site %like% 'Ofer' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Ofer plots were surveyed:
## Date ITime point_name SciName
## 1: 2014-07-30 12:00:00 Ofer 32.66032073_34.97882237 Ablepharus rueppellii
## 2: 2014-07-30 12:20:00 Ofer 32.66116094_34.96865537 Ablepharus rueppellii
## 3: 2014-07-30 13:44:00 Ofer Kkl Plantings 2 <NA>
## count_individuals
## 1: 1
## 2: 1
## 3: 0
reptiles[point_name == 'Ofer 33.17320998_35.5510869', point_name := 'Ofer Kkl 1']
reptiles[point_name == 'Ofer 32.66032073_34.97882237', point_name := 'Ofer Kkl 3']
# Only 2 plots in Zuriel in T0 - why?
reptiles[site %like% 'Zuriel' & campaign == 'T0', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # By comparing to the original data file, we can see that all 3 Zuriel plots were surveyed:
## Date ITime point_name SciName
## 1: 2014-08-04 12:07:00 Zuriel 33.013998_35.31735071 Hemidactylus turcicus
## 2: 2014-08-04 12:09:00 Zuriel 33.013998_35.31735071 Ablepharus rueppellii
## 3: 2014-08-04 13:15:00 Zuriel 33.01092878_35.31488161 Ablepharus rueppellii
## 4: 2014-08-04 13:17:00 Zuriel 33.01092878_35.31488161 Ablepharus rueppellii
## 5: 2014-08-04 13:19:00 Zuriel 33.01092878_35.31488161 Ablepharus rueppellii
## 6: 2014-08-04 13:21:00 Zuriel 33.01092878_35.31488161 Ablepharus rueppellii
## 7: 2014-08-04 15:25:00 Zuriel Kkl Plantings 1 <NA>
## count_individuals
## 1: 1
## 2: 1
## 3: 1
## 4: 1
## 5: 1
## 6: 1
## 7: 0
reptiles[point_name == 'Zuriel 33.013998_35.31735071', point_name := 'Zuriel Kkl 3']
reptiles[point_name == 'Zuriel 33.01092878_35.31488161', point_name := 'Zuriel Kkl 2']
# 4 plots in Ofer in T1 (2015) - why?
reptiles[site %like% 'Ofer' & campaign == 'T1', .(point_name, SciName, count_individuals), keyby = .(Date, ITime)] # 16.9.2015 = Kerem Maharal; 3.11.2015 = Ofer - but site names were reveresed!
## Date ITime point_name SciName
## 1: 2015-09-16 08:36:00 Ofer 32.65474897_34.97793598 Ablepharus rueppellii
## 2: 2015-09-16 08:36:00 Ofer 32.65474897_34.97793598 Hemidactylus turcicus
## 3: 2015-09-16 08:36:00 Ofer 32.65474897_34.97793598 Hemidactylus turcicus
## 4: 2015-09-16 08:36:00 Ofer 32.65474897_34.97793598 Hemidactylus turcicus
## 5: 2015-09-16 08:36:00 Ofer 32.65474897_34.97793598 Mediodactylus kotschyi
## 6: 2015-09-16 09:09:00 Kerem Maharal Kkl Plantings 1 Hemidactylus turcicus
## 7: 2015-09-16 09:49:00 Kerem Maharal Kkl Plantings 3 Ablepharus rueppellii
## 8: 2015-09-16 09:49:00 Kerem Maharal Kkl Plantings 3 Chalcides ocellatus
## 9: 2015-11-03 10:36:00 Ofer Kkl Plantings 1 Ablepharus rueppellii
## 10: 2015-11-03 10:36:00 Ofer Kkl Plantings 1 Ablepharus rueppellii
## 11: 2015-11-03 10:36:00 Ofer Kkl Plantings 1 Ablepharus rueppellii
## 12: 2015-11-03 10:36:00 Ofer Kkl Plantings 1 Ablepharus rueppellii
## 13: 2015-11-03 10:36:00 Ofer Kkl Plantings 1 Ablepharus rueppellii
## 14: 2015-11-03 10:36:00 Ofer Kkl Plantings 1 Mediodactylus kotschyi
## 15: 2015-11-03 10:36:00 Ofer Kkl Plantings 1 Mediodactylus kotschyi
## count_individuals
## 1: 1
## 2: 6
## 3: 2
## 4: 1
## 5: 2
## 6: 1
## 7: 1
## 8: 1
## 9: 2
## 10: 1
## 11: 2
## 12: 1
## 13: 1
## 14: 1
## 15: 2
reptiles[site %in% c('Ofer', 'Kerem Maharal') & campaign == 'T1', .(site, point_name, SciName, count_individuals), keyby = .(Date, ITime)]
## Date ITime site point_name
## 1: 2015-09-16 08:36:00 Ofer Ofer 32.65474897_34.97793598
## 2: 2015-09-16 08:36:00 Ofer Ofer 32.65474897_34.97793598
## 3: 2015-09-16 08:36:00 Ofer Ofer 32.65474897_34.97793598
## 4: 2015-09-16 08:36:00 Ofer Ofer 32.65474897_34.97793598
## 5: 2015-09-16 08:36:00 Ofer Ofer 32.65474897_34.97793598
## 6: 2015-09-16 09:09:00 Ofer Kerem Maharal Kkl Plantings 1
## 7: 2015-09-16 09:49:00 Ofer Kerem Maharal Kkl Plantings 3
## 8: 2015-09-16 09:49:00 Ofer Kerem Maharal Kkl Plantings 3
## 9: 2015-11-03 10:36:00 Ofer Ofer Kkl Plantings 1
## 10: 2015-11-03 10:36:00 Ofer Ofer Kkl Plantings 1
## 11: 2015-11-03 10:36:00 Ofer Ofer Kkl Plantings 1
## 12: 2015-11-03 10:36:00 Ofer Ofer Kkl Plantings 1
## 13: 2015-11-03 10:36:00 Ofer Ofer Kkl Plantings 1
## 14: 2015-11-03 10:36:00 Ofer Ofer Kkl Plantings 1
## 15: 2015-11-03 10:36:00 Ofer Ofer Kkl Plantings 1
## 16: 2015-11-03 11:06:00 Kerem Maharal Kerem Maharal 32.61227564_34.96368766
## 17: 2015-11-03 11:06:00 Kerem Maharal Kerem Maharal 32.61227564_34.96368766
## 18: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## 19: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## 20: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## 21: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## 22: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## 23: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## 24: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## 25: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## 26: 2015-11-03 11:54:00 Kerem Maharal Kerem Maharal 32.61601959_34.96652201
## Date ITime site point_name
## SciName count_individuals
## 1: Ablepharus rueppellii 1
## 2: Hemidactylus turcicus 6
## 3: Hemidactylus turcicus 2
## 4: Hemidactylus turcicus 1
## 5: Mediodactylus kotschyi 2
## 6: Hemidactylus turcicus 1
## 7: Ablepharus rueppellii 1
## 8: Chalcides ocellatus 1
## 9: Ablepharus rueppellii 2
## 10: Ablepharus rueppellii 1
## 11: Ablepharus rueppellii 2
## 12: Ablepharus rueppellii 1
## 13: Ablepharus rueppellii 1
## 14: Mediodactylus kotschyi 1
## 15: Mediodactylus kotschyi 2
## 16: Ablepharus rueppellii 1
## 17: Ablepharus rueppellii 2
## 18: Ablepharus rueppellii 3
## 19: Ablepharus rueppellii 2
## 20: Ablepharus rueppellii 1
## 21: Ablepharus rueppellii 1
## 22: Ablepharus rueppellii 1
## 23: Ablepharus rueppellii 1
## 24: Ablepharus rueppellii 1
## 25: Mediodactylus kotschyi 2
## 26: Mediodactylus kotschyi 2
## SciName count_individuals
reptiles[site %in% c('Ofer', 'Kerem Maharal') & Date == as.Date('2015-09-16'), ':=' (site = 'Ofer',
point_name = str_replace(point_name, 'Kerem Maharal', 'Ofer'))]
reptiles[site %in% c('Ofer', 'Kerem Maharal') & Date == as.Date('2015-11-03'), ':=' (site = 'Kerem Maharal',
point_name = str_replace(point_name, 'Ofer', 'Kerem Maharal'))]
reptiles[point_name == 'Kerem Maharal Far 1', point_name := 'Kerem Maharal Kkl Plantings 1']
reptiles[site %in% c('Ofer', 'Kerem Maharal'), .(no.of.plots = uniqueN(point_name)), keyby = .(campaign, unit, site)] # Now all is okay
## campaign unit site no.of.plots
## 1: T0 Planted Conifer Forests Kerem Maharal 3
## 2: T0 Planted Conifer Forests Ofer 3
## 3: T1 Planted Conifer Forests Kerem Maharal 3
## 4: T1 Planted Conifer Forests Ofer 3
## 5: T2 Planted Conifer Forests Kerem Maharal 3
## 6: T2 Planted Conifer Forests Ofer 3
## 7: T3 Planted Conifer Forests Kerem Maharal 3
## 8: T3 Planted Conifer Forests Ofer 3
## 9: T4 Planted Conifer Forests Kerem Maharal 3
## 10: T4 Planted Conifer Forests Ofer 3
# This is a zero count survey as per the Fulcrum - use the zero.obs object to include it!
# reptiles <- unique(rbind(reptiles, data.table(unit = 'Planted Conifer Forests', campaign = 'T1', year = 2015, site = 'Bat Shlomo',
# settlements = 'Far', SciName = NA, heb_name = NA, Occurrence = 0, subunit = 'Carmel',
# count_individuals = 0, point_name = 'Bat Shlomo Far 1',
# point_name = 'Bat Shlomo Far 1 - missing plot', Date = as.Date('2015-07-07'),
# Date.time = as.POSIXct('2015-07-07 09:03', tz = 'Asia/Jerusalem'), ITime = as.ITime('09:03')), fill = T))
# Kerem Maharal T1 (2015) should have 3 plots:
reptiles[site %like% 'Maharal' & campaign == 'T1',.(total.obs = sum(count_individuals)), keyby = .(Date, ITime, point_name)] #
## Date ITime point_name total.obs
## 1: 2015-11-03 10:36:00 Kerem Maharal Kkl Plantings 1 10
## 2: 2015-11-03 11:06:00 Kerem Maharal 32.61227564_34.96368766 3
## 3: 2015-11-03 11:54:00 Kerem Maharal 32.61601959_34.96652201 14
reptiles <- rbind(reptiles, data.table(unit = 'Planted Conifer Forests', campaign = 'T1', year = 2015, site = 'Kerem Maharal',
settlements = 'Far', SciName = 'Ablepharus rueppellii', heb_name = 'חומט גמד', Occurrence = 1,
subunit = 'Carmel', count_individuals = 7, point_name = 'Kerem Maharal Far 1',
Date = as.Date('2015-11-03'), Comments = 'Missing plot',
Date.time = as.POSIXct('2015-11-03 10:36', tz = 'Asia/Jerusalem'),
start_Time = as.ITime('10:36'), ITime = as.ITime('10:36')), fill = T)
reptiles <- rbind(reptiles, data.table(unit = 'Planted Conifer Forests', campaign = 'T1', year = 2015, site = 'Kerem Maharal',
settlements = 'Far', SciName = 'Mediodactylus orientalis', heb_name = 'שממית עצים', Occurrence = 1,
subunit = 'Carmel', count_individuals = 3, point_name = 'Kerem Maharal Far 1',
Date = as.Date('2015-11-03'), Comments = 'Missing plot',
start_Time = as.ITime('10:36'), Date.time = as.POSIXct('2015-11-03 10:36', tz = 'Asia/Jerusalem'), ITime = as.ITime('10:36')), fill = T)
reptiles[, survey_ID := paste(campaign, point_name, sep = '_')]
reptiles[point_name == '32.61601959_34.96652201' & campaign == 'T1', .(Date, SciName, count_individuals)]
## Empty data.table (0 rows and 3 cols): Date,SciName,count_individuals
reptiles[unit %like% 'Forest' & !is.na(SciName), .(total.abnd = sum(count_individuals), total.sp.rich = uniqueN(SciName))]
## total.abnd total.sp.rich
## 1: 593 25
reptiles[unit %like% 'Forest', .(no.of.surveys = uniqueN(survey_ID)), keyby = .(campaign, year, subunit, site)][no.of.surveys != 3]
## campaign year subunit site no.of.surveys
## 1: T1 2015 Carmel Kerem Maharal 4
## 2: T1 2015 Carmel Ramat Hashofet 2
# why 4 surveys in Kerem Maharal and 2 in Ramat Hashofet in T1 (2015)?
# We know that Ramat Hashofet 3 was not surveyed in 2015;
reptiles[site %in% reptiles[unit %like% 'Forest', .(no.of.surveys = uniqueN(survey_ID)), keyby = .(campaign, subunit, site)][no.of.surveys != 3, site],
.(campaign, site, point_name, Date, SciName, count_individuals)]
## campaign site point_name Date
## 1: T1 Kerem Maharal Kerem Maharal 32.61227564_34.96368766 2015-11-03
## 2: T1 Kerem Maharal Kerem Maharal 32.61227564_34.96368766 2015-11-03
## 3: T0 Kerem Maharal Kerem Maharal Kkl 3 2014-09-01
## 4: T0 Kerem Maharal Kerem Maharal Kkl 1 2014-09-01
## 5: T0 Kerem Maharal Kerem Maharal Kkl 1 2014-09-01
## 6: T0 Kerem Maharal Kerem Maharal Kkl 1 2014-09-01
## 7: T0 Kerem Maharal Kerem Maharal Kkl 1 2014-09-01
## 8: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 9: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 10: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 11: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 12: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 13: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 14: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 15: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 16: T1 Kerem Maharal Kerem Maharal 32.61601959_34.96652201 2015-11-03
## 17: T2 Kerem Maharal Kerem Maharal Kkl Plantings 1 2017-06-21
## 18: T2 Kerem Maharal Kerem Maharal Kkl Plantings 1 2017-06-21
## 19: T2 Kerem Maharal Kerem Maharal Kkl Plantings 1 2017-06-21
## 20: T2 Kerem Maharal Kerem Maharal Kkl Plantings 1 2017-06-21
## 21: T2 Kerem Maharal Kerem Maharal Kkl Plantings 1 2017-06-21
## 22: T2 Kerem Maharal Kerem Maharal Kkl Plantings 1 2017-06-21
## 23: T3 Kerem Maharal Kerem Maharal Kkl Plantings 1 2019-06-10
## 24: T3 Kerem Maharal Kerem Maharal Kkl Plantings 1 2019-06-10
## 25: T4 Kerem Maharal Kerem Maharal Kkl Plantings 1 2021-06-01
## 26: T2 Kerem Maharal Kerem Maharal Kkl Plantings 2 2017-06-21
## 27: T2 Kerem Maharal Kerem Maharal Kkl Plantings 2 2017-06-21
## 28: T4 Kerem Maharal Kerem Maharal Kkl Plantings 2 2021-06-01
## 29: T3 Kerem Maharal Kerem Maharal Kkl Plantings 2 2019-06-10
## 30: T0 Kerem Maharal Kerem Maharal Kkl Plantings 2 2014-09-01
## 31: T2 Kerem Maharal Kerem Maharal Kkl Plantings 3 2017-06-21
## 32: T2 Kerem Maharal Kerem Maharal Kkl Plantings 3 2017-06-21
## 33: T2 Kerem Maharal Kerem Maharal Kkl Plantings 3 2017-06-21
## 34: T3 Kerem Maharal Kerem Maharal Kkl Plantings 3 2019-06-10
## 35: T4 Kerem Maharal Kerem Maharal Kkl Plantings 3 2021-06-01
## 36: T1 Kerem Maharal Kerem Maharal Kkl Plantings 1 2015-11-03
## 37: T1 Kerem Maharal Kerem Maharal Kkl Plantings 1 2015-11-03
## 38: T1 Kerem Maharal Kerem Maharal Kkl Plantings 1 2015-11-03
## 39: T1 Kerem Maharal Kerem Maharal Kkl Plantings 1 2015-11-03
## 40: T1 Kerem Maharal Kerem Maharal Kkl Plantings 1 2015-11-03
## 41: T1 Kerem Maharal Kerem Maharal Kkl Plantings 1 2015-11-03
## 42: T1 Kerem Maharal Kerem Maharal Kkl Plantings 1 2015-11-03
## 43: T2 Ramat Hashofet Ramat Hashofet - Kkl Plantings 1 2017-08-01
## 44: T0 Ramat Hashofet Ramat Hashofet - Kkl Plantings 1 2014-07-22
## 45: T2 Ramat Hashofet Ramat Hashofet - Kkl Plantings 2 2017-08-01
## 46: T0 Ramat Hashofet Ramat Hashofet - Kkl Plantings 2 2014-07-22
## 47: T0 Ramat Hashofet Ramat Hashofet - Kkl Plantings 3 2014-07-22
## 48: T1 Ramat Hashofet Ramat Hashofet 32.61710013_35.11234171 2015-11-03
## 49: T1 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2015-11-03
## 50: T1 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2015-11-03
## 51: T1 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2015-11-03
## 52: T1 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2015-11-03
## 53: T1 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2015-11-03
## 54: T3 Ramat Hashofet Ramat Hashofet 32.61710013_35.11234171 2019-06-29
## 55: T4 Ramat Hashofet Ramat Hashofet 32.61710013_35.11234171 2021-07-05
## 56: T3 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2019-06-29
## 57: T3 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2019-06-29
## 58: T3 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2019-06-29
## 59: T4 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2021-07-05
## 60: T4 Ramat Hashofet Ramat Hashofet 32.62225135_35.11265519 2021-07-05
## 61: T2 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2017-08-01
## 62: T2 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2017-08-01
## 63: T2 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2017-08-01
## 64: T2 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2017-08-01
## 65: T3 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2019-06-29
## 66: T3 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2019-06-29
## 67: T3 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2019-06-29
## 68: T3 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2019-06-29
## 69: T3 Ramat Hashofet Ramat Hashofet Kkl Plantings 4 2019-06-29
## 70: T4 Ramat Hashofet Ramat Hashofet Kkl Plantings 4a 2021-07-05
## 71: T4 Ramat Hashofet Ramat Hashofet Kkl Plantings 4a 2021-07-05
## 72: T4 Ramat Hashofet Ramat Hashofet Kkl Plantings 4a 2021-07-05
## 73: T1 Kerem Maharal Kerem Maharal Far 1 2015-11-03
## 74: T1 Kerem Maharal Kerem Maharal Far 1 2015-11-03
## campaign site point_name Date
## SciName count_individuals
## 1: Ablepharus rueppellii 1
## 2: Ablepharus rueppellii 2
## 3: Hemidactylus turcicus 1
## 4: Ablepharus rueppellii 1
## 5: Ablepharus rueppellii 1
## 6: Ablepharus rueppellii 1
## 7: Platyceps collaris 1
## 8: Ablepharus rueppellii 3
## 9: Ablepharus rueppellii 2
## 10: Ablepharus rueppellii 1
## 11: Ablepharus rueppellii 1
## 12: Ablepharus rueppellii 1
## 13: Ablepharus rueppellii 1
## 14: Ablepharus rueppellii 1
## 15: Mediodactylus kotschyi 2
## 16: Mediodactylus kotschyi 2
## 17: Ptyodactylus guttatus 1
## 18: Hemidactylus turcicus 1
## 19: Mediodactylus kotschyi 1
## 20: Hemidactylus turcicus 1
## 21: Ablepharus rueppellii 1
## 22: Mediodactylus kotschyi 2
## 23: Telescopus fallax 1
## 24: Mediodactylus kotschyi 2
## 25: Hemidactylus turcicus 1
## 26: Mediodactylus kotschyi 2
## 27: Hemidactylus turcicus 2
## 28: Phoenicolacerta laevis 1
## 29: <NA> 0
## 30: <NA> 0
## 31: Stellagama stellio 1
## 32: Mediodactylus kotschyi 1
## 33: Heremites vittatus 1
## 34: Ophisops elegans 1
## 35: Stellagama stellio 1
## 36: Ablepharus rueppellii 2
## 37: Ablepharus rueppellii 1
## 38: Ablepharus rueppellii 2
## 39: Ablepharus rueppellii 1
## 40: Ablepharus rueppellii 1
## 41: Mediodactylus kotschyi 1
## 42: Mediodactylus kotschyi 2
## 43: <NA> 0
## 44: <NA> 0
## 45: <NA> 0
## 46: <NA> 0
## 47: <NA> 0
## 48: Ablepharus rueppellii 1
## 49: Ablepharus rueppellii 2
## 50: Ablepharus rueppellii 1
## 51: Ablepharus rueppellii 1
## 52: Ablepharus rueppellii 1
## 53: Mediodactylus kotschyi 1
## 54: Ablepharus rueppellii 1
## 55: Mediodactylus kotschyi 1
## 56: Hemidactylus turcicus 1
## 57: Ablepharus rueppellii 1
## 58: Platyceps collaris 1
## 59: Ablepharus rueppellii 11
## 60: Hemidactylus turcicus 1
## 61: Mediodactylus kotschyi 1
## 62: Mediodactylus kotschyi 1
## 63: Platyceps collaris 1
## 64: Stellagama stellio 1
## 65: Chalcides guentheri 1
## 66: Ablepharus rueppellii 1
## 67: Ablepharus rueppellii 1
## 68: Chalcides ocellatus 1
## 69: Chalcides guentheri 1
## 70: Mediodactylus kotschyi 2
## 71: Platyceps collaris 1
## 72: Platyceps collaris 1
## 73: Ablepharus rueppellii 7
## 74: Mediodactylus orientalis 3
## SciName count_individuals
# Kerem Maharal Far 1 should be the same as Kerem Maharal Kkl Plantings 1:
reptiles[point_name %in% c('Kerem Maharal Far 1', 'Kerem Maharal Kkl 1', 'Kerem Maharal Kkl Plantings 1'),
':=' (point_name = 'Kerem Maharal Kkl Plantings 1', survey_ID = paste(campaign, 'Kerem Maharal Kkl Plantings 1', sep = '_'))]
reptiles[unit %like% 'Forest', .(no.of.surveys = uniqueN(survey_ID)), keyby = .(campaign, year, subunit, site)][no.of.surveys != 3]
## campaign year subunit site no.of.surveys
## 1: T1 2015 Carmel Ramat Hashofet 2
# Make sure all survey IDs have the same coordinates (when available):
reptiles[, ':=' (mean.lat = mean(mean.lat, na.rm = T), mean.lon = mean(mean.lon, na.rm =T)), keyby = survey_ID]
reptiles[is.na(mean.lat) | is.na(mean.lon)]
## point_name site campaign year
## 1: Aderet 31.67867469_34.98154177 Aderet T0 2014
## 2: Bat Shlomo Far 1 Bat Shlomo T0 2014
## 3: Bat Shlomo Far 2 Bat Shlomo T0 2014
## 4: Eitanim Far 1 Eitanim T0 2014
## 5: Eitanim Far 3 Eitanim T0 2014
## 6: Eshsel Hanasai Agri 2 Eshel Hanasi T0 2014
## 7: Eshtaol Far 1 Eshtaol T0 2014
## 8: Givat Yeshayahu Far 1 Givat Yeshayahu T0 2014
## 9: Kerem Maharal Kkl Plantings 2 Kerem Maharal T0 2014
## 10: Lahav Far 3 Lahav T0 2014
## 11: Lehavim Far 1 Lehavim T0 2014
## 12: Lehavim Near 12 Lehavim T0 2014
## 13: Lehavim Near 6 Lehavim T0 2014
## 14: Manara Kkl Plantings 3 Manara T0 2014
## 15: Meron 32.99189342_35.45548018 Meron T0 2014
## 16: Meron Kkl Plantings 1 Meron T0 2014
## 17: Meron Kkl Plantings 2 Meron T0 2014
## 18: Mishmar Hanegev Kkl 2 Mishmar Hanegev T0 2014
## 19: Ofer Kkl Plantings 2 Ofer T0 2014
## 20: Ramat Hashofet - Kkl Plantings 1 Ramat Hashofet T0 2014
## 21: Ramat Hashofet - Kkl Plantings 2 Ramat Hashofet T0 2014
## 22: Ramat Hashofet - Kkl Plantings 3 Ramat Hashofet T0 2014
## 23: Sayeret Shaked Kkl 3 Sayeret Shaked T0 2014
## 24: Sayeret Shaked Kkl 4 Sayeret Shaked T0 2014
## 25: Sayeret Shaked Loess 31.27486693_34.68890758 Sayeret Shaked T0 2014
## 26: Zuriel Kkl Plantings 1 Zuriel T0 2014
## 27: Bat Shlomo Far 1 Bat Shlomo T1 2015
## 28: Eitanim Far 2 Eitanim T1 2015
## 29: Eshtaol Far 3 Eshtaol T1 2015
## 30: Eshtaol Far 4 Eshtaol T1 2015
## 31: Goral Bedouin Agriculture 1 Goral T1 2016
## 32: Goral Bedouin Agriculture 3 Goral T1 2016
## 33: Lehavim Near 11 Lehavim T1 2016
## 34: Manara Far 2 Manara T1 2015
## 35: Manara Far 3 Manara T1 2015
## 36: Meron Far 1 Meron T1 2015
## 37: Meron Far 2 Meron T1 2015
## 38: Ramot Naftali Kkl Plantings 1 Ramot Naftali T1 2015
## 39: Zuriel Far 1 Zuriel T1 2015
## 40: Eitanim 31.77492651_35.09886264 Eitanim T2 2017
## 41: Eitanim Kkl Plantings 2 Eitanim T2 2017
## 42: Eshsel Hanasai Agri 3 Eshel Hanasi T2 2018
## 43: Manara - Kkl Plantings 1 Manara T2 2017
## 44: Nahal Ashan Loess 2 Nahal Ashan T2 2018
## 45: Park Loess Loess 2 Park Loess T2 2018
## 46: Ramat Hashofet - Kkl Plantings 1 Ramat Hashofet T2 2017
## 47: Ramat Hashofet - Kkl Plantings 2 Ramat Hashofet T2 2017
## 48: Zuriel - Kkl Plantings 2 Zuriel T2 2017
## 49: Zuriel - Kkl Plantings 3 Zuriel T2 2017
## 50: Eitanim 31.77814645_35.10938566 Eitanim T3 2019
## 51: Eshsel Hanasai Agri 3 Eshel Hanasi T3 2020
## 52: Goral Bedouin Agriculture 1 Goral T3 2020
## 53: Kerem Maharal Kkl Plantings 2 Kerem Maharal T3 2019
## 54: Meron Kkl Plantings 1 Meron T3 2019
## 55: Meron Kkl Plantings 2 Meron T3 2019
## 56: Mishmar Hanegev Kkl 1 Mishmar Hanegev T3 2020
## 57: Ramot Naftali Kkl Plantings 3 Ramot Naftali T3 2019
## 58: Sayeret Shaked Kkl Plantings 3 Sayeret Shaked T3 2020
## 59: Sayeret Shaked Loess 2 Sayeret Shaked T3 2020
## 60: Zuriel Kkl Plantings 1 Zuriel T3 2019
## 61: Eitanim 31.77814645_35.10938566 Eitanim T4 2021
## 62: Eitanim Kkl Plantings 3a Eitanim T4 2021
## 63: Kabri 33.02024909_35.15766172 Kabri T4 2021
## 64: Kabri 33.02051057_35.16410644 Kabri T4 2021
## 65: Kabri 33.02076963_35.17121742 Kabri T4 2021
## 66: Manara Kkl Plantings 2 Manara T4 2021
## 67: Zuriel 33.01398017_35.31735242 Zuriel T4 2021
## 68: Zuriel Kkl Plantings 1a Zuriel T4 2021
## point_name site campaign year
## unit subunit settlements
## 1: Planted Conifer Forests Judean Highlands <NA>
## 2: Planted Conifer Forests Carmel <NA>
## 3: Planted Conifer Forests Carmel <NA>
## 4: Planted Conifer Forests Judean Highlands <NA>
## 5: Planted Conifer Forests Judean Highlands <NA>
## 6: Loess Covered Areas in the Northern Negev <NA> <NA>
## 7: Planted Conifer Forests Judean Highlands <NA>
## 8: Planted Conifer Forests Judean Highlands <NA>
## 9: Planted Conifer Forests Carmel <NA>
## 10: Mediterranean-Desert Transition Zone <NA> Far
## 11: Mediterranean-Desert Transition Zone <NA> Far
## 12: Mediterranean-Desert Transition Zone <NA> Near
## 13: Mediterranean-Desert Transition Zone <NA> Near
## 14: Planted Conifer Forests Galilee <NA>
## 15: Planted Conifer Forests Galilee <NA>
## 16: Planted Conifer Forests Galilee <NA>
## 17: Planted Conifer Forests Galilee <NA>
## 18: Loess Covered Areas in the Northern Negev <NA> <NA>
## 19: Planted Conifer Forests Carmel <NA>
## 20: Planted Conifer Forests Carmel <NA>
## 21: Planted Conifer Forests Carmel <NA>
## 22: Planted Conifer Forests Carmel <NA>
## 23: Loess Covered Areas in the Northern Negev <NA> <NA>
## 24: Loess Covered Areas in the Northern Negev <NA> <NA>
## 25: Loess Covered Areas in the Northern Negev <NA> <NA>
## 26: Planted Conifer Forests Galilee <NA>
## 27: Planted Conifer Forests Carmel <NA>
## 28: Planted Conifer Forests Judean Highlands <NA>
## 29: Planted Conifer Forests Judean Highlands <NA>
## 30: Planted Conifer Forests Judean Highlands <NA>
## 31: Loess Covered Areas in the Northern Negev <NA> <NA>
## 32: Loess Covered Areas in the Northern Negev <NA> <NA>
## 33: Mediterranean-Desert Transition Zone <NA> Near
## 34: Planted Conifer Forests Galilee <NA>
## 35: Planted Conifer Forests Galilee <NA>
## 36: Planted Conifer Forests Galilee <NA>
## 37: Planted Conifer Forests Galilee <NA>
## 38: Planted Conifer Forests Galilee <NA>
## 39: Planted Conifer Forests Galilee <NA>
## 40: Planted Conifer Forests Judean Highlands <NA>
## 41: Planted Conifer Forests Judean Highlands <NA>
## 42: Loess Covered Areas in the Northern Negev <NA> <NA>
## 43: Planted Conifer Forests Galilee <NA>
## 44: Loess Covered Areas in the Northern Negev <NA> <NA>
## 45: Loess Covered Areas in the Northern Negev <NA> <NA>
## 46: Planted Conifer Forests Carmel <NA>
## 47: Planted Conifer Forests Carmel <NA>
## 48: Planted Conifer Forests Galilee <NA>
## 49: Planted Conifer Forests Galilee <NA>
## 50: Planted Conifer Forests Judean Highlands <NA>
## 51: Loess Covered Areas in the Northern Negev <NA> <NA>
## 52: Loess Covered Areas in the Northern Negev <NA> <NA>
## 53: Planted Conifer Forests Carmel <NA>
## 54: Planted Conifer Forests Galilee <NA>
## 55: Planted Conifer Forests Galilee <NA>
## 56: Loess Covered Areas in the Northern Negev <NA> <NA>
## 57: Planted Conifer Forests Galilee <NA>
## 58: Loess Covered Areas in the Northern Negev <NA> <NA>
## 59: Loess Covered Areas in the Northern Negev <NA> <NA>
## 60: Planted Conifer Forests Galilee <NA>
## 61: Planted Conifer Forests Judean Highlands <NA>
## 62: Planted Conifer Forests Judean Highlands <NA>
## 63: Planted Conifer Forests Galilee <NA>
## 64: Planted Conifer Forests Galilee <NA>
## 65: Planted Conifer Forests Galilee <NA>
## 66: Planted Conifer Forests Galilee <NA>
## 67: Planted Conifer Forests Galilee <NA>
## 68: Planted Conifer Forests Galilee <NA>
## unit subunit settlements
## agriculture habitat dunes observations_id latitude longitude
## 1: <NA> <NA> <NA> <NA> NA NA
## 2: <NA> <NA> <NA> <NA> NA NA
## 3: <NA> <NA> <NA> <NA> NA NA
## 4: <NA> <NA> <NA> <NA> NA NA
## 5: <NA> <NA> <NA> <NA> NA NA
## 6: <NA> bedouin agriculture <NA> <NA> NA NA
## 7: <NA> <NA> <NA> <NA> NA NA
## 8: <NA> <NA> <NA> <NA> NA NA
## 9: <NA> <NA> <NA> <NA> NA NA
## 10: <NA> <NA> <NA> <NA> NA NA
## 11: <NA> <NA> <NA> <NA> NA NA
## 12: <NA> <NA> <NA> <NA> 31.36355 34.82061
## 13: <NA> <NA> <NA> NA NA
## 14: <NA> <NA> <NA> <NA> NA NA
## 15: <NA> <NA> <NA> <NA> NA NA
## 16: <NA> <NA> <NA> <NA> 32.98578 35.45576
## 17: <NA> <NA> <NA> <NA> 32.98362 35.46043
## 18: <NA> kkl plantings <NA> <NA> NA NA
## 19: <NA> <NA> <NA> <NA> NA NA
## 20: <NA> <NA> <NA> <NA> 32.61716 35.11097
## 21: <NA> <NA> <NA> <NA> 32.62246 35.11242
## 22: <NA> <NA> <NA> <NA> NA NA
## 23: <NA> kkl plantings <NA> <NA> NA NA
## 24: <NA> kkl plantings <NA> <NA> NA NA
## 25: <NA> loess <NA> <NA> NA NA
## 26: <NA> <NA> <NA> <NA> NA NA
## 27: <NA> <NA> <NA> <NA> 32.59022 35.01345
## 28: <NA> <NA> <NA> <NA> 31.77909 35.10360
## 29: <NA> <NA> <NA> <NA> 31.78694 35.02194
## 30: <NA> <NA> <NA> <NA> 31.78378 35.02057
## 31: <NA> bedouin agriculture <NA> <NA> 31.30934 34.80304
## 32: <NA> bedouin agriculture <NA> <NA> 31.31367 34.80409
## 33: <NA> <NA> <NA> <NA> 31.36598 34.82240
## 34: <NA> <NA> <NA> <NA> 33.17319 35.55109
## 35: <NA> <NA> <NA> <NA> 33.17772 35.54867
## 36: <NA> <NA> <NA> <NA> 32.98578 35.45576
## 37: <NA> <NA> <NA> <NA> 32.98362 35.46043
## 38: <NA> <NA> <NA> <NA> 33.09508 35.56110
## 39: <NA> <NA> <NA> <NA> 33.01709 35.31004
## 40: <NA> <NA> <NA> <NA> 31.77477 35.09921
## 41: <NA> <NA> <NA> <NA> 31.77874 35.10405
## 42: <NA> bedouin agriculture <NA> <NA> 31.34242 34.70882
## 43: <NA> <NA> <NA> <NA> 33.18277 35.54830
## 44: <NA> loess <NA> <NA> 31.29275 34.76666
## 45: <NA> loess <NA> <NA> 31.21745 34.57616
## 46: <NA> <NA> <NA> <NA> 32.61716 35.11097
## 47: <NA> <NA> <NA> <NA> 32.62246 35.11242
## 48: <NA> <NA> <NA> <NA> 33.01091 35.31488
## 49: <NA> <NA> <NA> <NA> 33.01465 35.31627
## 50: <NA> <NA> <NA> <NA> 31.77856 35.10954
## 51: <NA> bedouin agriculture <NA> <NA> 31.34202 34.70916
## 52: <NA> bedouin agriculture <NA> <NA> 31.30934 34.80304
## 53: <NA> <NA> <NA> <NA> 32.65495 34.97832
## 54: <NA> <NA> <NA> <NA> 32.98493 35.45730
## 55: <NA> <NA> <NA> <NA> 32.98319 35.46100
## 56: <NA> kkl plantings <NA> <NA> 31.36351 34.73423
## 57: <NA> <NA> <NA> <NA> 33.09805 35.56416
## 58: <NA> kkl plantings <NA> <NA> 31.26307 34.65954
## 59: <NA> loess <NA> <NA> 31.27296 34.69526
## 60: <NA> <NA> <NA> <NA> 33.01695 35.30958
## 61: <NA> <NA> <NA> <NA> 31.77841 35.10956
## 62: <NA> <NA> <NA> <NA> 31.78114 35.08761
## 63: <NA> <NA> <NA> <NA> 33.02025 35.15766
## 64: <NA> <NA> <NA> <NA> 33.02051 35.16411
## 65: <NA> <NA> <NA> <NA> 33.02077 35.17122
## 66: <NA> <NA> <NA> <NA> 33.17293 35.55013
## 67: <NA> <NA> <NA> <NA> 33.01373 35.31759
## 68: <NA> <NA> <NA> <NA> 33.01687 35.30778
## agriculture habitat dunes observations_id latitude longitude
## date time date_end time_end activity orientation type body tail
## 1: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 2: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 3: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 4: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 5: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 6: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 7: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 8: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 9: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 10: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 11: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 12: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 13: 24/04/2014 11:23:00 feces on rock NA <NA>
## 14: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 15: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 16: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 17: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 18: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 19: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 20: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 21: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 22: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 23: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 24: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 25: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 26: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 27: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 28: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 29: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 30: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 31: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 32: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 33: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 34: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 35: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 36: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 37: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 38: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 39: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 40: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 41: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 42: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 43: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 44: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 45: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 46: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 47: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 48: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 49: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 50: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 51: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 52: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 53: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 54: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 55: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 56: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 57: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 58: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 59: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 60: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 61: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 62: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 63: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 64: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 65: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 66: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 67: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## 68: <NA> <NA> <NA> <NA> <NA> <NA> <NA> NA <NA>
## date time date_end time_end activity orientation type body tail
## tail_type SciName stones_flipped weather temp_shade temp_sun
## 1: <NA> <NA> NA <NA> NA NA
## 2: <NA> <NA> NA <NA> NA NA
## 3: <NA> <NA> NA <NA> NA NA
## 4: <NA> <NA> NA <NA> NA NA
## 5: <NA> <NA> NA <NA> NA NA
## 6: <NA> <NA> NA <NA> NA NA
## 7: <NA> <NA> NA <NA> NA NA
## 8: <NA> <NA> NA <NA> NA NA
## 9: <NA> <NA> NA <NA> NA NA
## 10: <NA> <NA> NA <NA> NA NA
## 11: <NA> <NA> NA <NA> NA NA
## 12: <NA> <NA> NA <NA> NA NA
## 13: <NA> Laudakia vulgaris NA <NA> NA NA
## 14: <NA> <NA> NA <NA> NA NA
## 15: <NA> <NA> NA <NA> NA NA
## 16: <NA> <NA> NA <NA> NA NA
## 17: <NA> <NA> NA <NA> NA NA
## 18: <NA> <NA> NA <NA> NA NA
## 19: <NA> <NA> NA <NA> NA NA
## 20: <NA> <NA> NA <NA> NA NA
## 21: <NA> <NA> NA <NA> NA NA
## 22: <NA> <NA> NA <NA> NA NA
## 23: <NA> <NA> NA <NA> NA NA
## 24: <NA> <NA> NA <NA> NA NA
## 25: <NA> <NA> NA <NA> NA NA
## 26: <NA> <NA> NA <NA> NA NA
## 27: <NA> <NA> NA <NA> NA NA
## 28: <NA> <NA> NA <NA> NA NA
## 29: <NA> <NA> NA <NA> NA NA
## 30: <NA> <NA> NA <NA> NA NA
## 31: <NA> <NA> NA <NA> NA NA
## 32: <NA> <NA> NA <NA> NA NA
## 33: <NA> <NA> NA <NA> NA NA
## 34: <NA> <NA> NA <NA> NA NA
## 35: <NA> <NA> NA <NA> NA NA
## 36: <NA> <NA> NA <NA> NA NA
## 37: <NA> <NA> NA <NA> NA NA
## 38: <NA> <NA> NA <NA> NA NA
## 39: <NA> <NA> NA <NA> NA NA
## 40: <NA> <NA> NA <NA> NA NA
## 41: <NA> <NA> NA <NA> NA NA
## 42: <NA> <NA> NA <NA> NA NA
## 43: <NA> <NA> NA <NA> NA NA
## 44: <NA> <NA> NA <NA> NA NA
## 45: <NA> <NA> NA <NA> NA NA
## 46: <NA> <NA> NA <NA> NA NA
## 47: <NA> <NA> NA <NA> NA NA
## 48: <NA> <NA> NA <NA> NA NA
## 49: <NA> <NA> NA <NA> NA NA
## 50: <NA> <NA> NA <NA> NA NA
## 51: <NA> <NA> NA <NA> NA NA
## 52: <NA> <NA> NA <NA> NA NA
## 53: <NA> <NA> NA <NA> NA NA
## 54: <NA> <NA> NA <NA> NA NA
## 55: <NA> <NA> NA <NA> NA NA
## 56: <NA> <NA> NA <NA> NA NA
## 57: <NA> <NA> NA <NA> NA NA
## 58: <NA> <NA> NA <NA> NA NA
## 59: <NA> <NA> NA <NA> NA NA
## 60: <NA> <NA> NA <NA> NA NA
## 61: <NA> <NA> NA <NA> NA NA
## 62: <NA> <NA> NA <NA> NA NA
## 63: <NA> <NA> NA <NA> NA NA
## 64: <NA> <NA> NA <NA> NA NA
## 65: <NA> <NA> NA <NA> NA NA
## 66: <NA> <NA> NA <NA> NA NA
## 67: <NA> <NA> NA <NA> NA NA
## 68: <NA> <NA> NA <NA> NA NA
## tail_type SciName stones_flipped weather temp_shade temp_sun
## site_description obs_snout_len obs_tail_len obs_regentail_len material
## 1: <NA> NA NA NA <NA>
## 2: <NA> NA NA NA <NA>
## 3: <NA> NA NA NA <NA>
## 4: <NA> NA NA NA <NA>
## 5: <NA> NA NA NA <NA>
## 6: <NA> NA NA NA <NA>
## 7: <NA> NA NA NA <NA>
## 8: <NA> NA NA NA <NA>
## 9: <NA> NA NA NA <NA>
## 10: <NA> NA NA NA <NA>
## 11: <NA> NA NA NA <NA>
## 12: <NA> NA NA NA <NA>
## 13: <NA> NA NA NA <NA>
## 14: <NA> NA NA NA <NA>
## 15: <NA> NA NA NA <NA>
## 16: <NA> NA NA NA <NA>
## 17: <NA> NA NA NA <NA>
## 18: <NA> NA NA NA <NA>
## 19: <NA> NA NA NA <NA>
## 20: <NA> NA NA NA <NA>
## 21: <NA> NA NA NA <NA>
## 22: <NA> NA NA NA <NA>
## 23: <NA> NA NA NA <NA>
## 24: <NA> NA NA NA <NA>
## 25: <NA> NA NA NA <NA>
## 26: <NA> NA NA NA <NA>
## 27: <NA> NA NA NA <NA>
## 28: <NA> NA NA NA <NA>
## 29: <NA> NA NA NA <NA>
## 30: <NA> NA NA NA <NA>
## 31: <NA> NA NA NA <NA>
## 32: <NA> NA NA NA <NA>
## 33: <NA> NA NA NA <NA>
## 34: <NA> NA NA NA <NA>
## 35: <NA> NA NA NA <NA>
## 36: <NA> NA NA NA <NA>
## 37: <NA> NA NA NA <NA>
## 38: <NA> NA NA NA <NA>
## 39: <NA> NA NA NA <NA>
## 40: <NA> NA NA NA <NA>
## 41: <NA> NA NA NA <NA>
## 42: <NA> NA NA NA <NA>
## 43: <NA> NA NA NA <NA>
## 44: <NA> NA NA NA <NA>
## 45: <NA> NA NA NA <NA>
## 46: <NA> NA NA NA <NA>
## 47: <NA> NA NA NA <NA>
## 48: <NA> NA NA NA <NA>
## 49: <NA> NA NA NA <NA>
## 50: <NA> NA NA NA <NA>
## 51: <NA> NA NA NA <NA>
## 52: <NA> NA NA NA <NA>
## 53: <NA> NA NA NA <NA>
## 54: <NA> NA NA NA <NA>
## 55: <NA> NA NA NA <NA>
## 56: <NA> NA NA NA <NA>
## 57: <NA> NA NA NA <NA>
## 58: <NA> NA NA NA <NA>
## 59: <NA> NA NA NA <NA>
## 60: <NA> NA NA NA <NA>
## 61: <NA> NA NA NA <NA>
## 62: <NA> NA NA NA <NA>
## 63: <NA> NA NA NA <NA>
## 64: <NA> NA NA NA <NA>
## 65: <NA> NA NA NA <NA>
## 66: <NA> NA NA NA <NA>
## 67: <NA> NA NA NA <NA>
## 68: <NA> NA NA NA <NA>
## site_description obs_snout_len obs_tail_len obs_regentail_len material
## obs_notes disturbance sv t regen_t substrate survey_protocol
## 1: <NA> <NA> NA NA NA <NA> <NA>
## 2: <NA> <NA> NA NA NA <NA> <NA>
## 3: <NA> <NA> NA NA NA <NA> <NA>
## 4: <NA> <NA> NA NA NA <NA> <NA>
## 5: <NA> <NA> NA NA NA <NA> <NA>
## 6: <NA> <NA> NA NA NA <NA> <NA>
## 7: <NA> <NA> NA NA NA <NA> <NA>
## 8: <NA> <NA> NA NA NA <NA> <NA>
## 9: <NA> <NA> NA NA NA <NA> <NA>
## 10: <NA> <NA> NA NA NA <NA> <NA>
## 11: <NA> <NA> NA NA NA <NA> <NA>
## 12: <NA> <NA> NA NA NA <NA> <NA>
## 13: <NA> <NA> NA NA NA <NA> scan
## 14: <NA> <NA> NA NA NA <NA> <NA>
## 15: <NA> <NA> NA NA NA <NA> <NA>
## 16: <NA> <NA> NA NA NA <NA> <NA>
## 17: <NA> <NA> NA NA NA <NA> <NA>
## 18: <NA> <NA> NA NA NA <NA> <NA>
## 19: <NA> <NA> NA NA NA <NA> <NA>
## 20: <NA> <NA> NA NA NA <NA> <NA>
## 21: <NA> <NA> NA NA NA <NA> <NA>
## 22: <NA> <NA> NA NA NA <NA> <NA>
## 23: <NA> <NA> NA NA NA <NA> <NA>
## 24: <NA> <NA> NA NA NA <NA> <NA>
## 25: <NA> <NA> NA NA NA <NA> <NA>
## 26: <NA> <NA> NA NA NA <NA> <NA>
## 27: <NA> <NA> NA NA NA <NA> <NA>
## 28: <NA> <NA> NA NA NA <NA> <NA>
## 29: <NA> <NA> NA NA NA <NA> <NA>
## 30: <NA> <NA> NA NA NA <NA> <NA>
## 31: <NA> <NA> NA NA NA <NA> <NA>
## 32: <NA> <NA> NA NA NA <NA> <NA>
## 33: <NA> <NA> NA NA NA <NA> <NA>
## 34: <NA> <NA> NA NA NA <NA> <NA>
## 35: <NA> <NA> NA NA NA <NA> <NA>
## 36: <NA> <NA> NA NA NA <NA> <NA>
## 37: <NA> <NA> NA NA NA <NA> <NA>
## 38: <NA> <NA> NA NA NA <NA> <NA>
## 39: <NA> <NA> NA NA NA <NA> <NA>
## 40: <NA> <NA> NA NA NA <NA> <NA>
## 41: <NA> <NA> NA NA NA <NA> <NA>
## 42: <NA> <NA> NA NA NA <NA> <NA>
## 43: <NA> <NA> NA NA NA <NA> <NA>
## 44: <NA> <NA> NA NA NA <NA> <NA>
## 45: <NA> <NA> NA NA NA <NA> <NA>
## 46: <NA> <NA> NA NA NA <NA> <NA>
## 47: <NA> <NA> NA NA NA <NA> <NA>
## 48: <NA> <NA> NA NA NA <NA> <NA>
## 49: <NA> <NA> NA NA NA <NA> <NA>
## 50: <NA> <NA> NA NA NA <NA> <NA>
## 51: <NA> <NA> NA NA NA <NA> <NA>
## 52: <NA> <NA> NA NA NA <NA> <NA>
## 53: <NA> <NA> NA NA NA <NA> <NA>
## 54: <NA> <NA> NA NA NA <NA> <NA>
## 55: <NA> <NA> NA NA NA <NA> <NA>
## 56: <NA> <NA> NA NA NA <NA> <NA>
## 57: <NA> <NA> NA NA NA <NA> <NA>
## 58: <NA> <NA> NA NA NA <NA> <NA>
## 59: <NA> <NA> NA NA NA <NA> <NA>
## 60: <NA> <NA> NA NA NA <NA> <NA>
## 61: <NA> <NA> NA NA NA <NA> <NA>
## 62: <NA> <NA> NA NA NA <NA> <NA>
## 63: <NA> <NA> NA NA NA <NA> <NA>
## 64: <NA> <NA> NA NA NA <NA> <NA>
## 65: <NA> <NA> NA NA NA <NA> <NA>
## 66: <NA> <NA> NA NA NA <NA> <NA>
## 67: <NA> <NA> NA NA NA <NA> <NA>
## 68: <NA> <NA> NA NA NA <NA> <NA>
## obs_notes disturbance sv t regen_t substrate survey_protocol
## count_individuals weather_desc wind sex_new age observation_type Column
## 1: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 2: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 3: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 4: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 5: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 6: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 7: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 8: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 9: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 10: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 11: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 12: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 13: 1 <NA> <NA> <NA> <NA> indirect <NA>
## 14: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 15: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 16: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 17: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 18: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 19: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 20: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 21: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 22: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 23: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 24: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 25: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 26: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 27: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 28: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 29: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 30: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 31: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 32: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 33: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 34: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 35: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 36: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 37: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 38: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 39: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 40: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 41: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 42: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 43: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 44: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 45: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 46: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 47: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 48: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 49: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 50: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 51: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 52: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 53: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 54: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 55: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 56: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 57: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 58: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 59: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 60: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 61: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 62: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 63: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 64: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 65: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 66: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 67: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## 68: 0 <NA> <NA> <NA> <NA> <NA> <NA>
## count_individuals weather_desc wind sex_new age observation_type Column
## mean.lat mean.lon conc_lat_lon Date ITime start_Time
## 1: NaN NaN <NA> 2014-09-24 09:45:00 09:45:00
## 2: NaN NaN <NA> 2014-07-30 11:20:00 11:20:00
## 3: NaN NaN <NA> 2014-07-30 10:53:00 10:53:00
## 4: NaN NaN <NA> 2014-08-11 11:50:00 11:50:00
## 5: NaN NaN <NA> 2014-08-11 10:45:00 10:45:00
## 6: NaN NaN <NA> 2014-06-16 14:50:00 14:50:00
## 7: NaN NaN <NA> 2014-08-10 11:58:00 11:58:00
## 8: NaN NaN <NA> 2014-08-31 14:40:00 14:40:00
## 9: NaN NaN <NA> 2014-09-01 09:42:00 09:42:00
## 10: NaN NaN <NA> 2014-05-05 09:45:00 09:45:00
## 11: NaN NaN <NA> 2014-04-24 15:00:00 15:00:00
## 12: NaN NaN <NA> 2014-06-26 17:15:00 17:15:00
## 13: NaN NaN NA_NA 2014-04-24 10:23:00 11:23:00
## 14: NaN NaN <NA> 2014-08-05 11:50:00 11:50:00
## 15: NaN NaN <NA> 2014-09-01 14:15:00 14:15:00
## 16: NaN NaN <NA> 2014-09-01 13:15:00 13:15:00
## 17: NaN NaN <NA> 2014-09-01 13:40:00 13:40:00
## 18: NaN NaN <NA> 2014-07-01 12:05:00 12:05:00
## 19: NaN NaN <NA> 2014-07-30 13:44:00 13:44:00
## 20: NaN NaN <NA> 2014-07-22 13:04:00 13:04:00
## 21: NaN NaN <NA> 2014-07-22 14:25:00 14:25:00
## 22: NaN NaN <NA> 2014-07-22 13:45:00 13:45:00
## 23: NaN NaN <NA> 2014-06-16 12:30:00 12:30:00
## 24: NaN NaN <NA> 2014-06-16 11:15:00 11:15:00
## 25: NaN NaN <NA> 2014-06-16 10:00:00 10:00:00
## 26: NaN NaN <NA> 2014-08-04 15:25:00 15:25:00
## 27: NaN NaN <NA> 2015-07-07 09:03:00 09:03:00
## 28: NaN NaN <NA> 2015-10-21 14:30:00 14:30:00
## 29: NaN NaN <NA> 2015-06-18 11:31:00 11:31:00
## 30: NaN NaN <NA> 2015-06-18 12:04:00 12:04:00
## 31: NaN NaN <NA> 2016-05-24 10:02:00 10:02:00
## 32: NaN NaN <NA> 2016-05-24 12:13:00 12:13:00
## 33: NaN NaN 31.3659832_34.82240395 2016-04-07 11:20:00 11:20:00
## 34: NaN NaN <NA> 2015-05-20 14:40:00 14:40:00
## 35: NaN NaN <NA> 2015-05-20 15:17:00 15:17:00
## 36: NaN NaN <NA> 2015-11-25 14:23:00 14:23:00
## 37: NaN NaN <NA> 2015-11-25 16:08:00 16:08:00
## 38: NaN NaN <NA> 2015-06-17 13:50:00 13:50:00
## 39: NaN NaN <NA> 2015-11-25 12:46:00 12:46:00
## 40: NaN NaN <NA> 2017-07-16 10:33:00 10:33:00
## 41: NaN NaN <NA> 2017-07-16 11:07:00 11:07:00
## 42: NaN NaN <NA> 2018-05-08 18:00:00 18:00:00
## 43: NaN NaN <NA> 2017-04-26 15:26:00 15:26:00
## 44: NaN NaN <NA> 2018-04-30 16:56:00 16:56:00
## 45: NaN NaN <NA> 2018-05-20 10:17:00 10:17:00
## 46: NaN NaN <NA> 2017-08-01 10:56:00 10:56:00
## 47: NaN NaN <NA> 2017-08-01 10:21:00 10:21:00
## 48: NaN NaN <NA> 2017-05-10 14:50:00 14:50:00
## 49: NaN NaN <NA> 2017-05-10 15:18:00 15:18:00
## 50: NaN NaN <NA> 2019-05-20 10:26:00 10:26:00
## 51: NaN NaN <NA> 2020-06-01 16:35:00 16:35:00
## 52: NaN NaN <NA> 2020-06-10 14:49:00 14:49:00
## 53: NaN NaN <NA> 2019-06-10 10:30:00 10:30:00
## 54: NaN NaN <NA> 2019-06-19 14:58:00 14:58:00
## 55: NaN NaN <NA> 2019-06-19 15:35:00 15:35:00
## 56: NaN NaN <NA> 2020-06-22 09:42:00 09:42:00
## 57: NaN NaN <NA> 2019-06-12 14:44:00 14:44:00
## 58: NaN NaN <NA> 2020-06-01 13:48:00 13:48:00
## 59: NaN NaN <NA> 2020-06-22 07:00:00 07:00:00
## 60: NaN NaN <NA> 2019-05-29 14:19:00 14:19:00
## 61: NaN NaN <NA> 2021-06-15 10:25:00 10:25:00
## 62: NaN NaN <NA> 2021-06-15 09:00:00 09:00:00
## 63: NaN NaN <NA> 2021-07-05 16:51:00 16:51:00
## 64: NaN NaN <NA> 2021-07-05 17:44:00 17:44:00
## 65: NaN NaN <NA> 2021-07-05 18:15:00 18:15:00
## 66: NaN NaN <NA> 2021-05-05 15:10:00 15:10:00
## 67: NaN NaN <NA> 2021-06-23 18:19:00 18:19:00
## 68: NaN NaN <NA> 2021-06-23 17:01:00 17:01:00
## mean.lat mean.lon conc_lat_lon Date ITime start_Time
## Date.time
## 1: <NA>
## 2: <NA>
## 3: <NA>
## 4: <NA>
## 5: <NA>
## 6: <NA>
## 7: <NA>
## 8: <NA>
## 9: <NA>
## 10: <NA>
## 11: <NA>
## 12: <NA>
## 13: 2014-04-24 10:23:00
## 14: <NA>
## 15: <NA>
## 16: <NA>
## 17: <NA>
## 18: <NA>
## 19: <NA>
## 20: <NA>
## 21: <NA>
## 22: <NA>
## 23: <NA>
## 24: <NA>
## 25: <NA>
## 26: <NA>
## 27: <NA>
## 28: <NA>
## 29: <NA>
## 30: <NA>
## 31: <NA>
## 32: <NA>
## 33: <NA>
## 34: <NA>
## 35: <NA>
## 36: <NA>
## 37: <NA>
## 38: <NA>
## 39: <NA>
## 40: <NA>
## 41: <NA>
## 42: <NA>
## 43: <NA>
## 44: <NA>
## 45: <NA>
## 46: <NA>
## 47: <NA>
## 48: <NA>
## 49: <NA>
## 50: <NA>
## 51: <NA>
## 52: <NA>
## 53: <NA>
## 54: <NA>
## 55: <NA>
## 56: <NA>
## 57: <NA>
## 58: <NA>
## 59: <NA>
## 60: <NA>
## 61: <NA>
## 62: <NA>
## 63: <NA>
## 64: <NA>
## 65: <NA>
## 66: <NA>
## 67: <NA>
## 68: <NA>
## Date.time
## Comments
## 1: No coordinates were recorded
## 2: No coordinates were recorded
## 3: No coordinates were recorded
## 4: No coordinates were recorded
## 5: No coordinates were recorded
## 6: No coordinates were recorded
## 7: No coordinates were recorded
## 8: No coordinates were recorded
## 9: No coordinates were recorded
## 10: No coordinates were recorded
## 11: No coordinates were recorded
## 12: Coordinates taken from T1 2016 data
## 13: <NA>
## 14: No coordinates were recorded
## 15: No coordinates were recorded
## 16: Coordinates taken from T1 2016 data
## 17: Coordinates taken from T1 2016 data
## 18: No coordinates were recorded
## 19: No coordinates were recorded
## 20: Coordinates taken from T2 2018 data
## 21: Coordinates taken from T2 2018 data
## 22: No coordinates were recorded
## 23: In the records, the plot is called Park Hazerim Netiot and not Sayeret Shaked but this is the same area
## 24: In the records, the plot is called Park Hazerim Netiot and not Sayeret Shaked but this is the same area
## 25: In the records, the plot is called Park Hazerim Netiot and not Sayeret Shaked but this is the same area
## 26: No coordinates were recorded
## 27: <NA>
## 28: <NA>
## 29: <NA>
## 30: <NA>
## 31: <NA>
## 32: <NA>
## 33: <NA>
## 34: <NA>
## 35: <NA>
## 36: <NA>
## 37: <NA>
## 38: <NA>
## 39: <NA>
## 40: <NA>
## 41: <NA>
## 42: <NA>
## 43: <NA>
## 44: <NA>
## 45: <NA>
## 46: <NA>
## 47: <NA>
## 48: <NA>
## 49: <NA>
## 50: <NA>
## 51: <NA>
## 52: <NA>
## 53: <NA>
## 54: <NA>
## 55: <NA>
## 56: <NA>
## 57: <NA>
## 58: <NA>
## 59: <NA>
## 60: <NA>
## 61: <NA>
## 62: <NA>
## 63: <NA>
## 64: <NA>
## 65: <NA>
## 66: <NA>
## 67: <NA>
## 68: <NA>
## Comments
## new_plot_id
## 1: Aderet 31.67867469_34.98154177
## 2: <NA>
## 3: <NA>
## 4: <NA>
## 5: <NA>
## 6: <NA>
## 7: <NA>
## 8: <NA>
## 9: <NA>
## 10: Lahav Far 3
## 11: Lehavim Far 1
## 12: Lehavim Near 12
## 13: <NA>
## 14: <NA>
## 15: Meron 32.99189342_35.45548018
## 16: <NA>
## 17: <NA>
## 18: <NA>
## 19: <NA>
## 20: <NA>
## 21: <NA>
## 22: <NA>
## 23: <NA>
## 24: <NA>
## 25: Sayeret Shaked Loess 31.27486693_34.68890758
## 26: <NA>
## 27: <NA>
## 28: <NA>
## 29: <NA>
## 30: <NA>
## 31: <NA>
## 32: <NA>
## 33: Lehavim Near 11
## 34: <NA>
## 35: <NA>
## 36: <NA>
## 37: <NA>
## 38: Ramot Naftali Kkl Plantings 1
## 39: <NA>
## 40: Eitanim 31.77492651_35.09886264
## 41: Eitanim Kkl Plantings 2
## 42: <NA>
## 43: <NA>
## 44: Nahal Ashan Loess 2
## 45: Park Loess Loess 2
## 46: <NA>
## 47: <NA>
## 48: <NA>
## 49: <NA>
## 50: Eitanim 31.77814645_35.10938566
## 51: <NA>
## 52: <NA>
## 53: <NA>
## 54: <NA>
## 55: <NA>
## 56: <NA>
## 57: Ramot Naftali Kkl Plantings 3
## 58: Sayeret Shaked Kkl Plantings 3
## 59: <NA>
## 60: <NA>
## 61: Eitanim 31.77814645_35.10938566
## 62: <NA>
## 63: Kabri 33.02024909_35.15766172
## 64: Kabri 33.02051057_35.16410644
## 65: Kabri 33.02076963_35.17121742
## 66: Manara Kkl Plantings 2
## 67: Zuriel 33.01398017_35.31735242
## 68: <NA>
## new_plot_id
## survey_ID heb_name Occurrence
## 1: T0_Aderet 31.67867469_34.98154177 <NA> NA
## 2: T0_Bat Shlomo Far 1 <NA> NA
## 3: T0_Bat Shlomo Far 2 <NA> NA
## 4: T0_Eitanim Far 1 <NA> NA
## 5: T0_Eitanim Far 3 <NA> NA
## 6: T0_Eshsel Hanasai Agri 2 <NA> NA
## 7: T0_Eshtaol Far 1 <NA> NA
## 8: T0_Givat Yeshayahu Far 1 <NA> NA
## 9: T0_Kerem Maharal Kkl Plantings 2 <NA> NA
## 10: T0_Lahav Far 3 <NA> NA
## 11: T0_Lehavim Far 1 <NA> NA
## 12: T0_Lehavim Near 12 <NA> NA
## 13: T0_Lehavim Near 6 <NA> NA
## 14: T0_Manara Kkl Plantings 3 <NA> NA
## 15: T0_Meron 32.99189342_35.45548018 <NA> NA
## 16: T0_Meron Kkl Plantings 1 <NA> NA
## 17: T0_Meron Kkl Plantings 2 <NA> NA
## 18: T0_Mishmar Hanegev Kkl 2 <NA> NA
## 19: T0_Ofer Kkl Plantings 2 <NA> NA
## 20: T0_Ramat Hashofet - Kkl Plantings 1 <NA> NA
## 21: T0_Ramat Hashofet - Kkl Plantings 2 <NA> NA
## 22: T0_Ramat Hashofet - Kkl Plantings 3 <NA> NA
## 23: T0_Sayeret Shaked Kkl 3 <NA> NA
## 24: T0_Sayeret Shaked Kkl 4 <NA> NA
## 25: T0_Sayeret Shaked Loess 31.27486693_34.68890758 <NA> NA
## 26: T0_Zuriel Kkl Plantings 1 <NA> NA
## 27: T1_Bat Shlomo Far 1 <NA> NA
## 28: T1_Eitanim Far 2 <NA> NA
## 29: T1_Eshtaol Far 3 <NA> NA
## 30: T1_Eshtaol Far 4 <NA> NA
## 31: T1_Goral Bedouin Agriculture 1 <NA> NA
## 32: T1_Goral Bedouin Agriculture 3 <NA> NA
## 33: T1_Lehavim Near 11 <NA> NA
## 34: T1_Manara Far 2 <NA> NA
## 35: T1_Manara Far 3 <NA> NA
## 36: T1_Meron Far 1 <NA> NA
## 37: T1_Meron Far 2 <NA> NA
## 38: T1_Ramot Naftali Kkl Plantings 1 <NA> NA
## 39: T1_Zuriel Far 1 <NA> NA
## 40: T2_Eitanim 31.77492651_35.09886264 <NA> NA
## 41: T2_Eitanim Kkl Plantings 2 <NA> NA
## 42: T2_Eshsel Hanasai Agri 3 <NA> NA
## 43: T2_Manara - Kkl Plantings 1 <NA> NA
## 44: T2_Nahal Ashan Loess 2 <NA> NA
## 45: T2_Park Loess Loess 2 <NA> NA
## 46: T2_Ramat Hashofet - Kkl Plantings 1 <NA> NA
## 47: T2_Ramat Hashofet - Kkl Plantings 2 <NA> NA
## 48: T2_Zuriel - Kkl Plantings 2 <NA> NA
## 49: T2_Zuriel - Kkl Plantings 3 <NA> NA
## 50: T3_Eitanim 31.77814645_35.10938566 <NA> NA
## 51: T3_Eshsel Hanasai Agri 3 <NA> NA
## 52: T3_Goral Bedouin Agriculture 1 <NA> NA
## 53: T3_Kerem Maharal Kkl Plantings 2 <NA> NA
## 54: T3_Meron Kkl Plantings 1 <NA> NA
## 55: T3_Meron Kkl Plantings 2 <NA> NA
## 56: T3_Mishmar Hanegev Kkl 1 <NA> NA
## 57: T3_Ramot Naftali Kkl Plantings 3 <NA> NA
## 58: T3_Sayeret Shaked Kkl Plantings 3 <NA> NA
## 59: T3_Sayeret Shaked Loess 2 <NA> NA
## 60: T3_Zuriel Kkl Plantings 1 <NA> NA
## 61: T4_Eitanim 31.77814645_35.10938566 <NA> NA
## 62: T4_Eitanim Kkl Plantings 3a <NA> NA
## 63: T4_Kabri 33.02024909_35.15766172 <NA> NA
## 64: T4_Kabri 33.02051057_35.16410644 <NA> NA
## 65: T4_Kabri 33.02076963_35.17121742 <NA> NA
## 66: T4_Manara Kkl Plantings 2 <NA> NA
## 67: T4_Zuriel 33.01398017_35.31735242 <NA> NA
## 68: T4_Zuriel Kkl Plantings 1a <NA> NA
## survey_ID heb_name Occurrence
# Calculate a diel pattern via a cosinor model
reptiles[, .(no.of.times = uniqueN(ITime)), keyby = survey_ID][no.of.times > 1] # 72 cases where there is more than one time per survey ID!
## survey_ID no.of.times
## 1: T0_Aderet Kkl 2 2
## 2: T0_Aderet Kkl 3 2
## 3: T0_Amatzia 31.50752022_34.89495214 2
## 4: T0_Amatzia 31.51244878_34.8934848 3
## 5: T0_Ashdod Far Semi-Shifting 1 3
## 6: T0_Ashdod Far Semi-Shifting 2 4
## 7: T0_Ashdod Far Semi-Shifting 3 5
## 8: T0_Ashdod Far Shifting 1 3
## 9: T0_Ashdod Far Shifting 2 3
## 10: T0_Ashdod Far Shifting 3 4
## 11: T0_Ashdod Near Semi-Shifting 1 3
## 12: T0_Ashdod Near Semi-Shifting 2 2
## 13: T0_Ashdod Near Semi-Shifting 3 3
## 14: T0_Ashkelon Far Semi-Shifting 1 5
## 15: T0_Ashkelon Far Semi-Shifting 3 2
## 16: T0_Ashkelon Far Shifting 1 2
## 17: T0_Ashkelon Far Shifting 3 3
## 18: T0_Ashkelon Near Semi-Shifting 2 8
## 19: T0_Bat Shlomo Kkl 3 3
## 20: T0_Beit Yatir Far 31.35013846_35.11235947 2
## 21: T0_Beit Yatir Far 31.35114151_35.12245726 2
## 22: T0_Beit Yatir Far 31.36048202_35.13023961 5
## 23: T0_Beit Yatir Near 31.35936566_35.11638381 9
## 24: T0_Beit Yatir Near 31.3616697_35.10994797 5
## 25: T0_Beit Yatir Near 31.36983666_35.11023255 3
## 26: T0_Elyakim 32.66706551_35.05568276 2
## 27: T0_Elyakim 32.66729268_35.06300807 2
## 28: T0_Eshel Hanasi Bedouin Agriculture 31.33814194_34.71648947 6
## 29: T0_Eshel Hanasi Bedouin Agriculture 31.34189216_34.7090606 2
## 30: T0_Givat Yeshayahu 3 2
## 31: T0_Givot Bar Bedouin Agriculture 31.36034694_34.75049867 4
## 32: T0_Givot Bar Bedouin Agriculture 31.36423692_34.75671353 5
## 33: T0_Givot Bar Bedouin Agriculture 31.37352221_34.77122583 3
## 34: T0_Har Amasa Far 31.33245149_35.10733619 3
## 35: T0_Har Amasa Far 31.35044064_35.12192146 2
## 36: T0_Har Amasa Near 31.3435548_35.10418644 4
## 37: T0_Kabri 33.02026699_35.15765825 2
## 38: T0_Kerem Maharal Kkl Plantings 1 4
## 39: T0_Lahav Near 31.38116555_34.87381881 3
## 40: T0_Lahav Near 31.38184847_34.86639343 9
## 41: T0_Lehavim Far 31.3350892_34.83998961 2
## 42: T0_Lehavim Far 31.35798817_34.84029091 3
## 43: T0_Manara Kkl 2 2
## 44: T0_Mirsham Far 31.45827683_34.90100711 3
## 45: T0_Mirsham Far 31.5002719_34.92750673 4
## 46: T0_Mirsham Far 31.50077347_34.93924637 4
## 47: T0_Mirsham Near 31.47629966_34.92475669 6
## 48: T0_Mishmar Hanegev Bedouin Agriculture 31.35953705_34.74353936 5
## 49: T0_Mishmar Hanegev Bedouin Agriculture 31.36963753_34.74636994 2
## 50: T0_Mishmar Hanegev Bedouin Agriculture 31.37129176_34.73660277 4
## 51: T0_Mishmar Hanegev Kkl Plantings 31.36493851_34.72983363 2
## 52: T0_Nahal Ashan Kkl Plantings 2 3
## 53: T0_Nahal Ashan Loess 31.28245503_34.75764806 5
## 54: T0_Nahal Ashan Loess 31.29271253_34.76700752 2
## 55: T0_Netiv Haasara Far Semi-Shifting 1 2
## 56: T0_Netiv Haasara Far Semi-Shifting 2 2
## 57: T0_Netiv Haasara Far Shifting 1 2
## 58: T0_Netiv Haasara Far Shifting 2 3
## 59: T0_Netiv Haasara Far Shifting 3 3
## 60: T0_Netiv Haasara Near Semi-Shifting 1 2
## 61: T0_Park Loess Loess 31.21706343_34.57620702 9
## 62: T0_Park Loess Loess 31.22728013_34.60140018 11
## 63: T0_Park Loess Loess 31.24477105_34.60143498 11
## 64: T0_Ramot Naftali 33.09405282_35.56702946 2
## 65: T0_Ramot Naftali 33.09853595_35.56487564 2
## 66: T0_Sayeret Shaked Loess 31.27294696_34.69498356 2
## 67: T0_Zuriel Kkl 2 4
## 68: T0_Zuriel Kkl 3 2
## 69: T1_Ashdod Far Semi-Shifting 1 2
## 70: T1_Ashkelon Far Shifting 2 2
## 71: T1_Zikim Far Semi-Shifting 3 2
## 72: T1_Zikim Near Semi-Shifting 1 2
## survey_ID no.of.times
reptiles[, ITime := min(ITime, na.rm = T), keyby = survey_ID]
reptiles[, .(no.of.times = uniqueN(ITime)), keyby = survey_ID][no.of.times > 1] # Now this is an empty data.table
## Empty data.table (0 rows and 2 cols): survey_ID,no.of.times
reptiles[, Date.time := as.POSIXct(paste(Date, ITime, tz = 'Asia/Jerusalem'))] # Create a Date and time object
reptiles[, ':=' (dist.noon = ifelse(as.ITime(ITime) < as.ITime('12:00'), # If the starting hour is before noon...
Date.time %--% as.POSIXct(paste(Date, '12:00:00'), tz = 'Asia/Jerusalem'), # ...then take the distance from today's noon
Date.time %--% as.POSIXct(paste(Date , '12:00:00'), tz = 'Asia/Jerusalem')))] # else, take the distance from tomorrow's noon
reptiles[, .(max(dist.noon, na.rm = T), min(dist.noon, na.rm = T))] # from 22800 seconds (6 hours and 20 minutes) to ~27600 seconds (7 hours and 40 minutes)
## V1 V2
## 1: 22800 -27600
reptiles[dist.noon %in% c(min(dist.noon), max(dist.noon)), .(unit, site, Date, time, ITime)]
## unit site Date time ITime
## 1: Coastal Plain Sands Ashkelon 2015-10-06 6:40:00 05:40:00
## 2: Coastal Plain Sands Ashkelon 2015-10-06 6:40:00 05:40:00
## 3: Coastal Plain Sands Ashkelon 2015-10-06 6:40:00 05:40:00
## 4: Coastal Plain Sands Zikim 2019-08-19 20:40:00 19:40:00
## 5: Coastal Plain Sands Zikim 2019-08-19 20:40:00 19:40:00
## 6: Coastal Plain Sands Zikim 2019-08-19 20:40:00 19:40:00
hist(reptiles[, ITime], breaks = 24)
reptiles[is.na(dist.noon), sort(unique(Date.time))] # No missing distances to noon
## POSIXct of length 0
reptiles[is.na(dist.noon)] # should be an empty data.table
## Empty data.table (0 rows and 60 cols): point_name,site,campaign,year,unit,subunit...
ggplot(data = reptiles, aes(x = ITime, y = dist.noon)) + geom_point() # This does not seem good yet
## Don't know how to automatically pick scale for object of type <ITime>.
## Defaulting to continuous.
reptiles[, ':=' (dist.noon.radians = dist.noon * pi / (24*60*30), # Convert to radians, one harmonic; divide by the number of seconds in half a day
dist.noon.radians.2h = 2*dist.noon * pi / (24*60*30))] # same, two harmonics
reptiles[, .(min(dist.noon), min(dist.noon.radians), max(dist.noon), max(dist.noon.radians))]
## V1 V2 V3 V4
## 1: -27600 -2.007129 22800 1.658063
unique(reptiles[dist.noon == min(dist.noon), .(Date, ITime, dist.noon, dist.noon.radians)]) # 19:40 (latest hour of survey)
## Date ITime dist.noon dist.noon.radians
## 1: 2019-08-19 19:40:00 -27600 -2.007129
unique(reptiles[dist.noon == max(dist.noon), .(Date, ITime, dist.noon, dist.noon.radians)]) # 5:40 (earliest survey Date)
## Date ITime dist.noon dist.noon.radians
## 1: 2015-10-06 05:40:00 22800 1.658063
reptiles[, ':=' (sin.dist.noon = sin(dist.noon.radians), cos.dist.noon = cos(dist.noon.radians),
sin.dist.noon.2h = sin(dist.noon.radians.2h), cos.dist.noon.2h = cos(dist.noon.radians.2h))] # Calculate the sin and cosine of the distance from June 21st
plot(reptiles$ITime, reptiles$sin.dist.noon) # Sanity check - should be a wave
plot(reptiles$ITime, reptiles$sin.dist.noon.2h) # Sanity check - should be a denser wave
# subunits
reptiles[, uniqueN(survey_ID), keyby = subunit] # this makes sense, but note that sampling effort is uneven
## subunit V1
## 1: <NA> 473
## 2: Carmel 74
## 3: Galilee 75
## 4: Judean Highlands 75
# campaign
reptiles[, uniqueN(point_name), keyby = .(unit, campaign, year)] #
## unit campaign year V1
## 1: Coastal Plain Sands T0 2014 27
## 2: Coastal Plain Sands T1 2015 36
## 3: Coastal Plain Sands T2 2017 36
## 4: Coastal Plain Sands T3 2019 35
## 5: Coastal Plain Sands T4 2021 36
## 6: Inland Sands T2 2017 24
## 7: Inland Sands T3 2019 24
## 8: Inland Sands T4 2021 24
## 9: Loess Covered Areas in the Northern Negev T0 2014 27
## 10: Loess Covered Areas in the Northern Negev T1 2016 30
## 11: Loess Covered Areas in the Northern Negev T2 2018 28
## 12: Loess Covered Areas in the Northern Negev T3 2020 27
## 13: Mediterranean-Desert Transition Zone T0 2014 30
## 14: Mediterranean-Desert Transition Zone T1 2016 29
## 15: Mediterranean-Desert Transition Zone T2 2018 30
## 16: Mediterranean-Desert Transition Zone T3 2020 30
## 17: Planted Conifer Forests T0 2014 45
## 18: Planted Conifer Forests T1 2015 44
## 19: Planted Conifer Forests T2 2017 45
## 20: Planted Conifer Forests T3 2019 45
## 21: Planted Conifer Forests T4 2021 45
## unit campaign year V1
reptiles <- reptiles[year != 2013] # omit the 2013 pilot data
# settlements
reptiles[!is.na(settlements), .(no.of.plots = uniqueN(point_name)), keyby = .(unit, settlements)]
## unit settlements no.of.plots
## 1: Coastal Plain Sands Far 30
## 2: Coastal Plain Sands Near 15
## 3: Mediterranean-Desert Transition Zone Far 30
## 4: Mediterranean-Desert Transition Zone Near 28
## 5: Planted Conifer Forests Far 1
reptiles[unit %like% 'Forest', settlements := NA]
# Far or Near settlements is indicated in Coastal Plain Sands (unbalanced) and in Mediterranean-Desert Transition Zone (balanced)
# agriculture
reptiles[!is.na(agriculture), .(no.of.plots = uniqueN(point_name)), keyby = .(unit, agriculture)]
## unit agriculture no.of.plots
## 1: Inland Sands Far 19
## 2: Inland Sands Near 6
# Far or Near agriculture is indicated in inland sands (unbalanced)
# dunes
reptiles[!is.na(dunes), .(no.of.plots = uniqueN(point_name)), keyby = .(unit, dunes)]
## unit dunes no.of.plots
## 1: Coastal Plain Sands semi-shifting 30
## 2: Coastal Plain Sands shifting 15
## 3: Inland Sands semi-shifting 12
## 4: Inland Sands shifting 13
# dune type is indicated in inland sands (balanced) and in coastal dunes (unbalanced)
# habitat
reptiles[!is.na(habitat), .(no.of.plots = uniqueN(point_name), .N), keyby = .(unit, habitat)]
## unit habitat no.of.plots
## 1: Loess Covered Areas in the Northern Negev bedouin agriculture 22
## 2: Loess Covered Areas in the Northern Negev kkl plantings 17
## 3: Loess Covered Areas in the Northern Negev loess 18
## N
## 1: 101
## 2: 70
## 3: 114
reptiles[habitat %in% c('Agriculture', 'beduin agriculture'), habitat := 'bedouin agriculture']
reptiles[habitat == 'Loess', habitat := 'loess']
reptiles[habitat == 'KKL Plantings', habitat := 'kkl plantings']
reptiles[!is.na(habitat), .(no.of.plots = uniqueN(point_name), .N), keyby = .(unit, habitat)]
## unit habitat no.of.plots
## 1: Loess Covered Areas in the Northern Negev bedouin agriculture 22
## 2: Loess Covered Areas in the Northern Negev kkl plantings 17
## 3: Loess Covered Areas in the Northern Negev loess 18
## N
## 1: 101
## 2: 70
## 3: 114
# reptiles[!is.na(habitat), unit := 'Loess Covered Areas in the Northern Negev'] # Only the Loess should have 'habitat' field; all other units with a value in the habitat field are mistakes
reptiles[!is.na(habitat), .(no.of.plots = uniqueN(point_name), .N), keyby = .(unit, habitat)]
## unit habitat no.of.plots
## 1: Loess Covered Areas in the Northern Negev bedouin agriculture 22
## 2: Loess Covered Areas in the Northern Negev kkl plantings 17
## 3: Loess Covered Areas in the Northern Negev loess 18
## N
## 1: 101
## 2: 70
## 3: 114
# habitat type is indicated in loess (roughly balanced)
setorder(reptiles, unit, campaign, site, habitat, point_name, Date, ITime) # Make sure the observations are ordered sensibly
reptiles
## point_name site campaign year
## 1: Ashdod Far Semi-Shifting 1 Ashdod T0 2014
## 2: Ashdod Far Semi-Shifting 1 Ashdod T0 2014
## 3: Ashdod Far Semi-Shifting 1 Ashdod T0 2014
## 4: Ashdod Far Semi-Shifting 1 Ashdod T0 2014
## 5: Ashdod Far Semi-Shifting 2 Ashdod T0 2014
## ---
## 2814: Ramot Naftali Kkl Plantings 3 Ramot Naftali T4 2021
## 2815: Ramot Naftali Kkl Plantings 3 Ramot Naftali T4 2021
## 2816: Zuriel 33.01091098_35.31488335 Zuriel T4 2021
## 2817: Zuriel 33.01398017_35.31735242 Zuriel T4 2021
## 2818: Zuriel Kkl Plantings 1a Zuriel T4 2021
## unit subunit settlements agriculture habitat
## 1: Coastal Plain Sands <NA> Far <NA> <NA>
## 2: Coastal Plain Sands <NA> Far <NA> <NA>
## 3: Coastal Plain Sands <NA> Far <NA> <NA>
## 4: Coastal Plain Sands <NA> Far <NA> <NA>
## 5: Coastal Plain Sands <NA> Far <NA> <NA>
## ---
## 2814: Planted Conifer Forests Galilee <NA> <NA> <NA>
## 2815: Planted Conifer Forests Galilee <NA> <NA> <NA>
## 2816: Planted Conifer Forests Galilee <NA> <NA> <NA>
## 2817: Planted Conifer Forests Galilee <NA> <NA> <NA>
## 2818: Planted Conifer Forests Galilee <NA> <NA> <NA>
## dunes observations_id latitude longitude
## 1: semi-shifting 31.75179 34.61184
## 2: semi-shifting 31.75179 34.61184
## 3: semi-shifting 31.75179 34.61184
## 4: semi-shifting 31.75179 34.61184
## 5: semi-shifting 31.75970 34.63104
## ---
## 2814: <NA> eff99d74-057d-4a1d-9b8a-7bc48cc9c7f3 33.09852 35.56487
## 2815: <NA> 1573b26a-0f89-4a30-807c-3f31fb4f9794 33.09852 35.56487
## 2816: <NA> a1474f45-bb01-4787-ad4f-cc91bdd4bc68 33.01091 35.31488
## 2817: <NA> <NA> 33.01373 35.31759
## 2818: <NA> <NA> 33.01687 35.30778
## date time date_end time_end activity orientation
## 1: 01/10/2014 9:43:00 tracks <NA>
## 2: 01/10/2014 9:43:00 tracks <NA>
## 3: 30/09/2014 9:49:00 pitfall trap in
## 4: 30/09/2014 12:51:00 moving between
## 5: 01/10/2014 11:30:00 tracks <NA>
## ---
## 2814: 05/05/2021 17:35 <NA> <NA> moving between
## 2815: 05/05/2021 17:35 <NA> <NA> moving under
## 2816: 23/06/2021 17:48 <NA> <NA> shelter under
## 2817: <NA> <NA> <NA> <NA> <NA> <NA>
## 2818: <NA> <NA> <NA> <NA> <NA> <NA>
## type body tail tail_type SciName
## 1: <NA> NA <NA> <NA> Stenodactylus sthenodactylus
## 2: <NA> NA <NA> <NA> Chalcides sepsoides
## 3: pitfall trap 42 62 <NA> Acanthodactylus scutellatus
## 4: shrubs NA <NA> <NA> Acanthodactylus scutellatus
## 5: <NA> NA <NA> <NA> Stenodactylus sthenodactylus
## ---
## 2814: direct NA <NA> <NA> Heremites vittatus
## 2815: direct NA <NA> regenerated Heremites vittatus
## 2816: direct NA <NA> broken Ablepharus rueppellii
## 2817: <NA> NA <NA> <NA> <NA>
## 2818: <NA> NA <NA> <NA> <NA>
## stones_flipped weather temp_shade temp_sun site_description
## 1: NA NA NA
## 2: NA NA NA
## 3: NA <NA> NA NA <NA>
## 4: NA <NA> NA NA <NA>
## 5: NA NA NA
## ---
## 2814: 50 בהיר וחם 30.3 30.3
## 2815: 50 בהיר וחם 30.3 30.3
## 2816: 60 28.0 40.8
## 2817: NA <NA> NA NA <NA>
## 2818: NA <NA> NA NA <NA>
## obs_snout_len obs_tail_len obs_regentail_len material obs_notes
## 1: NA NA NA
## 2: NA NA NA
## 3: NA NA NA <NA> <NA>
## 4: NA NA NA <NA> <NA>
## 5: NA NA NA
## ---
## 2814: NA NA NA
## 2815: NA NA NA
## 2816: NA NA NA
## 2817: NA NA NA <NA> <NA>
## 2818: NA NA NA <NA> <NA>
## disturbance sv t regen_t substrate survey_protocol
## 1: NA NA NA trail
## 2: NA NA NA trail
## 3: <NA> NA NA NA <NA> trap
## 4: <NA> NA NA NA <NA> scan
## 5: NA NA NA trail
## ---
## 2814: NA NA NA annuals scan
## 2815: NA NA NA rock scan
## 2816: הפרעת רעיה בשטח,נבירות חזירי בר NA NA NA rock scan
## 2817: <NA> NA NA NA <NA> <NA>
## 2818: <NA> NA NA NA <NA> <NA>
## count_individuals weather_desc wind sex_new age observation_type
## 1: 16 indirect
## 2: 5 indirect
## 3: 1 <NA> <NA> <NA> subadult direct
## 4: 3 <NA> <NA> <NA> subadult direct
## 5: 6 indirect
## ---
## 2814: 1 direct
## 2815: 1 direct
## 2816: 1 direct
## 2817: 0 <NA> <NA> <NA> <NA> <NA>
## 2818: 0 <NA> <NA> <NA> <NA> <NA>
## Column mean.lat mean.lon conc_lat_lon Date ITime
## 1: <NA> 31.75179 34.61184 31.75178674_34.6118426 2014-09-30 08:43:00
## 2: <NA> 31.75179 34.61184 31.75178674_34.6118426 2014-09-30 08:43:00
## 3: <NA> 31.75179 34.61184 31.75178674_34.6118426 2014-09-30 08:43:00
## 4: <NA> 31.75179 34.61184 31.75178674_34.6118426 2014-09-30 08:43:00
## 5: <NA> 31.75970 34.63104 31.75970432_34.63104228 2014-09-30 10:30:00
## ---
## 2814: adult 33.09852 35.56487 33.0985172_35.56487462 2021-05-05 16:35:00
## 2815: adult 33.09852 35.56487 33.0985172_35.56487462 2021-05-05 16:35:00
## 2816: adult 33.01091 35.31488 33.01091098_35.31488335 2021-06-23 16:48:00
## 2817: <NA> NaN NaN <NA> 2021-06-23 18:19:00
## 2818: <NA> NaN NaN <NA> 2021-06-23 17:01:00
## start_Time Date.time Comments new_plot_id
## 1: 09:43:00 2014-09-30 08:43:00 <NA> <NA>
## 2: 09:43:00 2014-09-30 08:43:00 <NA> <NA>
## 3: 09:43:00 2014-09-30 08:43:00 <NA> <NA>
## 4: 09:43:00 2014-09-30 08:43:00 <NA> <NA>
## 5: 11:30:00 2014-09-30 10:30:00 <NA> <NA>
## ---
## 2814: 17:35:00 2021-05-05 16:35:00 <NA> Ramot Naftali Kkl Plantings 3
## 2815: 17:35:00 2021-05-05 16:35:00 <NA> Ramot Naftali Kkl Plantings 3
## 2816: 17:48:00 2021-06-23 16:48:00 <NA> Zuriel 33.01091098_35.31488335
## 2817: 18:19:00 2021-06-23 18:19:00 <NA> Zuriel 33.01398017_35.31735242
## 2818: 17:01:00 2021-06-23 17:01:00 <NA> <NA>
## survey_ID heb_name Occurrence dist.noon
## 1: T0_Ashdod Far Semi-Shifting 1 <NA> NA 11820
## 2: T0_Ashdod Far Semi-Shifting 1 <NA> NA 11820
## 3: T0_Ashdod Far Semi-Shifting 1 <NA> NA 11820
## 4: T0_Ashdod Far Semi-Shifting 1 <NA> NA 11820
## 5: T0_Ashdod Far Semi-Shifting 2 <NA> NA 5400
## ---
## 2814: T4_Ramot Naftali Kkl Plantings 3 <NA> NA -16500
## 2815: T4_Ramot Naftali Kkl Plantings 3 <NA> NA -16500
## 2816: T4_Zuriel 33.01091098_35.31488335 <NA> NA -17280
## 2817: T4_Zuriel 33.01398017_35.31735242 <NA> NA -22740
## 2818: T4_Zuriel Kkl Plantings 1a <NA> NA -18060
## dist.noon.radians dist.noon.radians.2h sin.dist.noon cos.dist.noon
## 1: 0.8595747 1.7191493 0.7575650 0.65275975
## 2: 0.8595747 1.7191493 0.7575650 0.65275975
## 3: 0.8595747 1.7191493 0.7575650 0.65275975
## 4: 0.8595747 1.7191493 0.7575650 0.65275975
## 5: 0.3926991 0.7853982 0.3826834 0.92387953
## ---
## 2814: -1.1999139 -2.3998277 -0.9320079 0.36243804
## 2815: -1.1999139 -2.3998277 -0.9320079 0.36243804
## 2816: -1.2566371 -2.5132741 -0.9510565 0.30901699
## 2817: -1.6536995 -3.3073989 -0.9965655 -0.08280821
## 2818: -1.3133603 -2.6267205 -0.9670459 0.25460195
## sin.dist.noon.2h cos.dist.noon.2h
## 1: 0.9890159 -0.1478094
## 2: 0.9890159 -0.1478094
## 3: 0.9890159 -0.1478094
## 4: 0.9890159 -0.1478094
## 5: 0.7071068 0.7071068
## ---
## 2814: -0.6755902 -0.7372773
## 2815: -0.6755902 -0.7372773
## 2816: -0.5877853 -0.8090170
## 2817: 0.1650476 -0.9862856
## 2818: -0.4924236 -0.8703557
## Sampling effort per unit----
reptiles[, .(no.of.surveys = uniqueN(survey_ID), no.of.plots = uniqueN(point_name), no.of.sites = uniqueN(site)),
keyby = .(unit, campaign, year)]
## unit campaign year no.of.surveys
## 1: Coastal Plain Sands T0 2014 27
## 2: Coastal Plain Sands T1 2015 36
## 3: Coastal Plain Sands T2 2017 36
## 4: Coastal Plain Sands T3 2019 35
## 5: Coastal Plain Sands T4 2021 36
## 6: Inland Sands T2 2017 24
## 7: Inland Sands T3 2019 24
## 8: Inland Sands T4 2021 24
## 9: Loess Covered Areas in the Northern Negev T0 2014 27
## 10: Loess Covered Areas in the Northern Negev T1 2016 30
## 11: Loess Covered Areas in the Northern Negev T2 2018 28
## 12: Loess Covered Areas in the Northern Negev T3 2020 27
## 13: Mediterranean-Desert Transition Zone T0 2014 30
## 14: Mediterranean-Desert Transition Zone T1 2016 29
## 15: Mediterranean-Desert Transition Zone T2 2018 30
## 16: Mediterranean-Desert Transition Zone T3 2020 30
## 17: Planted Conifer Forests T0 2014 45
## 18: Planted Conifer Forests T1 2015 44
## 19: Planted Conifer Forests T2 2017 45
## 20: Planted Conifer Forests T3 2019 45
## 21: Planted Conifer Forests T4 2021 45
## unit campaign year no.of.surveys
## no.of.plots no.of.sites
## 1: 27 3
## 2: 36 4
## 3: 36 4
## 4: 35 4
## 5: 36 4
## 6: 24 3
## 7: 24 3
## 8: 24 3
## 9: 27 6
## 10: 30 7
## 11: 28 7
## 12: 27 7
## 13: 30 5
## 14: 29 5
## 15: 30 5
## 16: 30 5
## 17: 45 15
## 18: 44 15
## 19: 45 15
## 20: 45 15
## 21: 45 15
## no.of.plots no.of.sites
reptiles[, .(no.of.surveys = uniqueN(survey_ID), no.of.plots = uniqueN(point_name), no.of.sites = uniqueN(site)),
keyby = .(unit, campaign)]
## unit campaign no.of.surveys
## 1: Coastal Plain Sands T0 27
## 2: Coastal Plain Sands T1 36
## 3: Coastal Plain Sands T2 36
## 4: Coastal Plain Sands T3 35
## 5: Coastal Plain Sands T4 36
## 6: Inland Sands T2 24
## 7: Inland Sands T3 24
## 8: Inland Sands T4 24
## 9: Loess Covered Areas in the Northern Negev T0 27
## 10: Loess Covered Areas in the Northern Negev T1 30
## 11: Loess Covered Areas in the Northern Negev T2 28
## 12: Loess Covered Areas in the Northern Negev T3 27
## 13: Mediterranean-Desert Transition Zone T0 30
## 14: Mediterranean-Desert Transition Zone T1 29
## 15: Mediterranean-Desert Transition Zone T2 30
## 16: Mediterranean-Desert Transition Zone T3 30
## 17: Planted Conifer Forests T0 45
## 18: Planted Conifer Forests T1 44
## 19: Planted Conifer Forests T2 45
## 20: Planted Conifer Forests T3 45
## 21: Planted Conifer Forests T4 45
## unit campaign no.of.surveys
## no.of.plots no.of.sites
## 1: 27 3
## 2: 36 4
## 3: 36 4
## 4: 35 4
## 5: 36 4
## 6: 24 3
## 7: 24 3
## 8: 24 3
## 9: 27 6
## 10: 30 7
## 11: 28 7
## 12: 27 7
## 13: 30 5
## 14: 29 5
## 15: 30 5
## 16: 30 5
## 17: 45 15
## 18: 44 15
## 19: 45 15
## 20: 45 15
## 21: 45 15
## no.of.plots no.of.sites
# # date and seasonality
reptiles[, sort(unique(date))] # Which dates are there in the data base?
## [1] "01/05/2019" "01/06/2020" "01/06/2021" "01/07/2014" "01/07/2017"
## [6] "01/08/2017" "01/09/2014" "01/10/2014" "02/05/2016" "02/06/2021"
## [11] "02/10/2014" "03/08/2017" "03/11/2015" "04/04/2018" "04/06/2021"
## [16] "04/08/2014" "04/11/2015" "05/05/2014" "05/05/2016" "05/05/2021"
## [21] "05/07/2016" "05/07/2021" "05/08/2014" "05/08/2019" "05/10/2014"
## [26] "05/10/2015" "06/04/2020" "06/08/2017" "06/09/2015" "06/10/2014"
## [31] "06/10/2015" "07/04/2016" "07/06/2016" "07/07/2015" "07/07/2021"
## [36] "08/04/2021" "08/05/2017" "08/05/2018" "09/09/2019" "10/04/2018"
## [41] "10/05/2016" "10/05/2017" "10/06/2014" "10/06/2019" "10/06/2020"
## [46] "10/07/2017" "10/08/2014" "10/09/2021" "11/07/2016" "11/08/2014"
## [51] "12/06/2019" "13/08/2017" "13/10/2014" "14/04/2016" "14/04/2020"
## [56] "14/05/2018" "14/06/2017" "14/10/2014" "15/05/2019" "15/06/2021"
## [61] "15/07/2019" "15/08/2021" "15/10/2021" "15/11/2015" "16/04/2014"
## [66] "16/06/2014" "16/07/2017" "16/09/2015" "17/04/2018" "17/05/2017"
## [71] "17/05/2019" "17/06/2015" "18/06/2015" "19/05/2016" "19/06/2017"
## [76] "19/06/2019" "19/08/2019" "20/05/2015" "20/05/2018" "20/05/2019"
## [81] "21/04/2016" "21/04/2020" "21/06/2017" "21/07/2019" "21/10/2015"
## [86] "22/05/2017" "22/05/2018" "22/05/2019" "22/06/2020" "22/07/2014"
## [91] "22/09/2015" "22/09/2021" "23/06/2014" "23/06/2021" "23/10/2015"
## [96] "24/03/2020" "24/04/2014" "24/05/2016" "24/05/2017" "24/07/2017"
## [101] "24/09/2014" "25/04/2019" "25/07/2021" "25/08/2019" "25/11/2015"
## [106] "26/04/2017" "26/05/2021" "26/06/2014" "26/06/2017" "26/09/2021"
## [111] "27/05/2014" "28/09/2015" "29/04/2017" "29/04/2019" "29/05/2019"
## [116] "29/06/2016" "29/06/2019" "29/08/2019" "30/04/2018" "30/07/2014"
## [121] "30/09/2014" "31/03/2020" "31/08/2014"
reptiles[, .(date = unique(date), Date = unique(as.Date(date, format = '%d/%m/%Y')))] # seems ok
## date Date
## 1: 01/10/2014 2014-10-01
## 2: 30/09/2014 2014-09-30
## 3: 02/10/2014 2014-10-02
## 4: 05/10/2014 2014-10-05
## 5: 06/10/2014 2014-10-06
## ---
## 120: 08/04/2021 2021-04-08
## 121: 01/06/2021 2021-06-01
## 122: 05/05/2021 2021-05-05
## 123: 23/06/2021 2021-06-23
## 124: 04/06/2021 2021-06-04
reptiles[is.na(date), .N] # 69 records with no dates
## [1] 69
reptiles[is.na(date) & is.na(Date)] # but no records with neither date or Date
## Empty data.table (0 rows and 66 cols): point_name,site,campaign,year,unit,subunit...
reptiles[!is.na(date) & is.na(as.Date(date))] # No dates would be converted to NAs via as.Date
## Empty data.table (0 rows and 66 cols): point_name,site,campaign,year,unit,subunit...
reptiles[, sort(unique(as.Date(date))), keyby = date] # this is clearly wrong
## date V1
## 1: 01/05/2019 0001-05-20
## 2: 01/06/2020 0001-06-20
## 3: 01/06/2021 0001-06-20
## 4: 01/07/2014 0001-07-20
## 5: 01/07/2017 0001-07-20
## ---
## 119: 30/04/2018 0030-04-20
## 120: 30/07/2014 0030-07-20
## 121: 30/09/2014 0030-09-20
## 122: 31/03/2020 0031-03-20
## 123: 31/08/2014 0031-08-20
reptiles[is.na(Date), Date := as.Date(date, format = '%d/%m/%Y')]
reptiles[is.na(Date), .N] # now there are no records without dates
## [1] 0
reptiles[, sort(unique(Date))] # Which dates are there in the data base?
## [1] "2014-04-16" "2014-04-24" "2014-05-05" "2014-05-27" "2014-06-10"
## [6] "2014-06-16" "2014-06-23" "2014-06-26" "2014-07-01" "2014-07-22"
## [11] "2014-07-30" "2014-08-04" "2014-08-05" "2014-08-10" "2014-08-11"
## [16] "2014-08-31" "2014-09-01" "2014-09-24" "2014-09-30" "2014-10-01"
## [21] "2014-10-02" "2014-10-05" "2014-10-06" "2014-10-13" "2014-10-14"
## [26] "2015-05-20" "2015-06-17" "2015-06-18" "2015-07-07" "2015-09-06"
## [31] "2015-09-16" "2015-09-22" "2015-09-28" "2015-10-05" "2015-10-06"
## [36] "2015-10-21" "2015-10-23" "2015-11-03" "2015-11-04" "2015-11-15"
## [41] "2015-11-25" "2016-04-07" "2016-04-14" "2016-04-21" "2016-05-02"
## [46] "2016-05-05" "2016-05-10" "2016-05-19" "2016-05-24" "2016-06-07"
## [51] "2016-06-29" "2016-07-05" "2016-07-11" "2017-04-26" "2017-04-29"
## [56] "2017-05-08" "2017-05-10" "2017-05-17" "2017-05-22" "2017-05-24"
## [61] "2017-06-14" "2017-06-19" "2017-06-21" "2017-06-26" "2017-07-01"
## [66] "2017-07-10" "2017-07-16" "2017-07-24" "2017-08-01" "2017-08-03"
## [71] "2017-08-06" "2017-08-13" "2018-04-04" "2018-04-10" "2018-04-17"
## [76] "2018-04-30" "2018-05-08" "2018-05-14" "2018-05-20" "2018-05-22"
## [81] "2019-04-25" "2019-04-29" "2019-05-01" "2019-05-15" "2019-05-17"
## [86] "2019-05-20" "2019-05-22" "2019-05-29" "2019-06-10" "2019-06-12"
## [91] "2019-06-19" "2019-06-29" "2019-07-15" "2019-07-21" "2019-08-05"
## [96] "2019-08-19" "2019-08-25" "2019-08-29" "2019-09-09" "2020-03-24"
## [101] "2020-03-31" "2020-04-06" "2020-04-14" "2020-04-21" "2020-06-01"
## [106] "2020-06-10" "2020-06-22" "2021-04-08" "2021-05-05" "2021-05-26"
## [111] "2021-06-01" "2021-06-02" "2021-06-04" "2021-06-15" "2021-06-23"
## [116] "2021-07-05" "2021-07-07" "2021-07-25" "2021-08-15" "2021-09-10"
## [121] "2021-09-22" "2021-09-26" "2021-10-15"
str(reptiles) # verify that "Date" is indeed defined as a date
## Classes 'data.table' and 'data.frame': 2818 obs. of 66 variables:
## $ point_name : chr "Ashdod Far Semi-Shifting 1" "Ashdod Far Semi-Shifting 1" "Ashdod Far Semi-Shifting 1" "Ashdod Far Semi-Shifting 1" ...
## $ site : chr "Ashdod" "Ashdod" "Ashdod" "Ashdod" ...
## $ campaign : chr "T0" "T0" "T0" "T0" ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ unit : chr "Coastal Plain Sands" "Coastal Plain Sands" "Coastal Plain Sands" "Coastal Plain Sands" ...
## $ subunit : chr NA NA NA NA ...
## $ settlements : chr "Far" "Far" "Far" "Far" ...
## $ agriculture : chr NA NA NA NA ...
## $ habitat : chr NA NA NA NA ...
## $ dunes : chr "semi-shifting" "semi-shifting" "semi-shifting" "semi-shifting" ...
## $ observations_id : chr "" "" "" "" ...
## $ latitude : num 31.8 31.8 31.8 31.8 31.8 ...
## $ longitude : num 34.6 34.6 34.6 34.6 34.6 ...
## $ date : chr "01/10/2014" "01/10/2014" "30/09/2014" "30/09/2014" ...
## $ time : chr "9:43:00" "9:43:00" "9:49:00" "12:51:00" ...
## $ date_end : chr "" "" "" "" ...
## $ time_end : chr "" "" "" "" ...
## $ activity : chr "tracks" "tracks" "pitfall trap" "moving" ...
## $ orientation : chr NA NA "in" "between" ...
## $ type : chr NA NA "pitfall trap" "shrubs" ...
## $ body : int NA NA 42 NA NA NA NA NA NA NA ...
## $ tail : chr NA NA "62" NA ...
## $ tail_type : chr NA NA NA NA ...
## $ SciName : chr "Stenodactylus sthenodactylus" "Chalcides sepsoides" "Acanthodactylus scutellatus" "Acanthodactylus scutellatus" ...
## $ stones_flipped : int NA NA NA NA NA NA NA NA NA NA ...
## $ weather : chr "" "" NA NA ...
## $ temp_shade : num NA NA NA NA NA NA NA NA NA NA ...
## $ temp_sun : num NA NA NA NA NA NA NA NA NA NA ...
## $ site_description : chr "" "" NA NA ...
## $ obs_snout_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ obs_tail_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ obs_regentail_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ material : chr "" "" NA NA ...
## $ obs_notes : chr "" "" NA NA ...
## $ disturbance : chr "" "" NA NA ...
## $ sv : int NA NA NA NA NA NA NA NA NA NA ...
## $ t : int NA NA NA NA NA NA NA NA NA NA ...
## $ regen_t : num NA NA NA NA NA NA NA NA NA NA ...
## $ substrate : chr "" "" NA NA ...
## $ survey_protocol : chr "trail" "trail" "trap" "scan" ...
## $ count_individuals : num 16 5 1 3 6 4 1 1 2 1 ...
## $ weather_desc : chr "" "" NA NA ...
## $ wind : chr "" "" NA NA ...
## $ sex_new : chr "" "" NA NA ...
## $ age : chr "" "" "subadult" "subadult" ...
## $ observation_type : chr "indirect" "indirect" "direct" "direct" ...
## $ Column : chr NA NA NA NA ...
## $ mean.lat : num 31.8 31.8 31.8 31.8 31.8 ...
## $ mean.lon : num 34.6 34.6 34.6 34.6 34.6 ...
## $ conc_lat_lon : chr "31.75178674_34.6118426" "31.75178674_34.6118426" "31.75178674_34.6118426" "31.75178674_34.6118426" ...
## $ Date : Date, format: "2014-09-30" "2014-09-30" ...
## $ ITime : 'ITime' int 08:43:00 08:43:00 08:43:00 08:43:00 10:30:00 10:30:00 10:30:00 10:30:00 10:30:00 10:30:00 ...
## $ start_Time : 'ITime' int 09:43:00 09:43:00 09:43:00 09:43:00 11:30:00 11:30:00 11:30:00 11:30:00 11:30:00 11:30:00 ...
## $ Date.time : POSIXct, format: "2014-09-30 08:43:00" "2014-09-30 08:43:00" ...
## $ Comments : chr NA NA NA NA ...
## $ new_plot_id : chr NA NA NA NA ...
## $ survey_ID : chr "T0_Ashdod Far Semi-Shifting 1" "T0_Ashdod Far Semi-Shifting 1" "T0_Ashdod Far Semi-Shifting 1" "T0_Ashdod Far Semi-Shifting 1" ...
## $ heb_name : chr NA NA NA NA ...
## $ Occurrence : num NA NA NA NA NA NA NA NA NA NA ...
## $ dist.noon : num 11820 11820 11820 11820 5400 ...
## $ dist.noon.radians : num 0.86 0.86 0.86 0.86 0.393 ...
## $ dist.noon.radians.2h: num 1.719 1.719 1.719 1.719 0.785 ...
## $ sin.dist.noon : num 0.758 0.758 0.758 0.758 0.383 ...
## $ cos.dist.noon : num 0.653 0.653 0.653 0.653 0.924 ...
## $ sin.dist.noon.2h : num 0.989 0.989 0.989 0.989 0.707 ...
## $ cos.dist.noon.2h : num -0.148 -0.148 -0.148 -0.148 0.707 ...
## - attr(*, ".internal.selfref")=<externalptr>
reptiles[, .(no.of.dates = uniqueN(Date)), keyby = .(campaign, unit, site, survey_ID)][no.of.dates > 1] # 25 cases in which there is more than one date per survey ID (all from T0)
## Empty data.table (0 rows and 5 cols): campaign,unit,site,survey_ID,no.of.dates
excessive_dates <- reptiles[, .(no.of.dates = uniqueN(Date)), keyby = .(campaign, unit, site, survey_ID)][no.of.dates > 1]
reptiles[survey_ID %in% excessive_dates$survey_ID, .(Date = unique(Date)), keyby = .(campaign, site, point_name, survey_ID)] # in some cases, these are different plots; in others, the dates are one day apart
## Empty data.table (0 rows and 5 cols): campaign,site,point_name,survey_ID,Date
reptiles[survey_ID == 'T2_NA', unique(point_name)] # very different plots are lumped here
## character(0)
reptiles[survey_ID == 'T2_NA', survey_ID := paste(campaign, point_name, sep = '_')]
excessive_dates <- reptiles[, .(no.of.dates = uniqueN(Date)), keyby = .(campaign, unit, site, survey_ID)][no.of.dates > 1]
reptiles[survey_ID %in% excessive_dates$survey_ID, .(Date = unique(Date)), keyby = .(campaign, site, point_name, survey_ID)] # now the dates are one day apart
## Empty data.table (0 rows and 5 cols): campaign,site,point_name,survey_ID,Date
bla <- copy(reptiles) # Back up before changing dates
bla[, Date := min(Date), keyby = survey_ID] # each survey's date will arbitrary gain its earliest date
bla[, sort(unique(Date))] # make sure the dates make sense
## [1] "2014-04-16" "2014-04-24" "2014-05-05" "2014-05-27" "2014-06-10"
## [6] "2014-06-16" "2014-06-23" "2014-06-26" "2014-07-01" "2014-07-22"
## [11] "2014-07-30" "2014-08-04" "2014-08-05" "2014-08-10" "2014-08-11"
## [16] "2014-08-31" "2014-09-01" "2014-09-24" "2014-09-30" "2014-10-01"
## [21] "2014-10-02" "2014-10-05" "2014-10-06" "2014-10-13" "2014-10-14"
## [26] "2015-05-20" "2015-06-17" "2015-06-18" "2015-07-07" "2015-09-06"
## [31] "2015-09-16" "2015-09-22" "2015-09-28" "2015-10-05" "2015-10-06"
## [36] "2015-10-21" "2015-10-23" "2015-11-03" "2015-11-04" "2015-11-15"
## [41] "2015-11-25" "2016-04-07" "2016-04-14" "2016-04-21" "2016-05-02"
## [46] "2016-05-05" "2016-05-10" "2016-05-19" "2016-05-24" "2016-06-07"
## [51] "2016-06-29" "2016-07-05" "2016-07-11" "2017-04-26" "2017-04-29"
## [56] "2017-05-08" "2017-05-10" "2017-05-17" "2017-05-22" "2017-05-24"
## [61] "2017-06-14" "2017-06-19" "2017-06-21" "2017-06-26" "2017-07-01"
## [66] "2017-07-10" "2017-07-16" "2017-07-24" "2017-08-01" "2017-08-03"
## [71] "2017-08-06" "2017-08-13" "2018-04-04" "2018-04-10" "2018-04-17"
## [76] "2018-04-30" "2018-05-08" "2018-05-14" "2018-05-20" "2018-05-22"
## [81] "2019-04-25" "2019-04-29" "2019-05-01" "2019-05-15" "2019-05-17"
## [86] "2019-05-20" "2019-05-22" "2019-05-29" "2019-06-10" "2019-06-12"
## [91] "2019-06-19" "2019-06-29" "2019-07-15" "2019-07-21" "2019-08-05"
## [96] "2019-08-19" "2019-08-25" "2019-08-29" "2019-09-09" "2020-03-24"
## [101] "2020-03-31" "2020-04-06" "2020-04-14" "2020-04-21" "2020-06-01"
## [106] "2020-06-10" "2020-06-22" "2021-04-08" "2021-05-05" "2021-05-26"
## [111] "2021-06-01" "2021-06-02" "2021-06-04" "2021-06-15" "2021-06-23"
## [116] "2021-07-05" "2021-07-07" "2021-07-25" "2021-08-15" "2021-09-10"
## [121] "2021-09-22" "2021-09-26" "2021-10-15"
bla[survey_ID %in% excessive_dates$survey_ID, .(Date = unique(Date)), keyby = .(campaign, site, point_name, survey_ID)] # now there is only one date per survey
## Empty data.table (0 rows and 5 cols): campaign,site,point_name,survey_ID,Date
bla[, .(no.of.dates = uniqueN(Date)), keyby = .(campaign, unit, site, survey_ID)][no.of.dates > 1] # no more multiple dates per survey
## Empty data.table (0 rows and 5 cols): campaign,unit,site,survey_ID,no.of.dates
reptiles <- copy(bla) # return to the original data name
rm(bla) # clean up
reptiles[, .(no.of.records = .N, sp.rich = uniqueN(SciName), first.yr = min(year), last.year = max(year)), keyby = .(unit)] # all records
## unit no.of.records sp.rich first.yr
## 1: Coastal Plain Sands 1000 20 2014
## 2: Inland Sands 598 18 2017
## 3: Loess Covered Areas in the Northern Negev 285 25 2014
## 4: Mediterranean-Desert Transition Zone 401 30 2014
## 5: Planted Conifer Forests 534 26 2014
## last.year
## 1: 2021
## 2: 2021
## 3: 2020
## 4: 2020
## 5: 2021
reptiles[, .(no.of.records = .N, sp.rich = uniqueN(heb_name)), keyby = .(unit)] # Should be the same, but species richness is not
## unit no.of.records sp.rich
## 1: Coastal Plain Sands 1000 1
## 2: Inland Sands 598 1
## 3: Loess Covered Areas in the Northern Negev 285 1
## 4: Mediterranean-Desert Transition Zone 401 1
## 5: Planted Conifer Forests 534 3
reptiles[, .(first.survey = min(Date), last.survey = max(Date)), keyby = .(unit, campaign)]
## unit campaign first.survey last.survey
## 1: Coastal Plain Sands T0 2014-09-30 2014-10-14
## 2: Coastal Plain Sands T1 2015-09-16 2015-10-23
## 3: Coastal Plain Sands T2 2017-07-24 2017-08-13
## 4: Coastal Plain Sands T3 2019-08-19 2019-09-09
## 5: Coastal Plain Sands T4 2021-09-10 2021-10-15
## 6: Inland Sands T2 2017-06-14 2017-07-01
## 7: Inland Sands T3 2019-07-15 2019-08-05
## 8: Inland Sands T4 2021-07-07 2021-08-15
## 9: Loess Covered Areas in the Northern Negev T0 2014-06-16 2014-07-01
## 10: Loess Covered Areas in the Northern Negev T1 2016-05-10 2016-07-11
## 11: Loess Covered Areas in the Northern Negev T2 2018-04-04 2018-05-20
## 12: Loess Covered Areas in the Northern Negev T3 2020-06-01 2020-06-22
## 13: Mediterranean-Desert Transition Zone T0 2014-04-16 2014-06-26
## 14: Mediterranean-Desert Transition Zone T1 2016-04-07 2016-05-05
## 15: Mediterranean-Desert Transition Zone T2 2018-04-04 2018-05-22
## 16: Mediterranean-Desert Transition Zone T3 2020-03-24 2020-04-21
## 17: Planted Conifer Forests T0 2014-07-22 2014-09-24
## 18: Planted Conifer Forests T1 2015-05-20 2015-11-25
## 19: Planted Conifer Forests T2 2017-04-26 2017-08-01
## 20: Planted Conifer Forests T3 2019-04-25 2019-06-29
## 21: Planted Conifer Forests T4 2021-04-08 2021-07-05
## unit campaign first.survey last.survey
# reptiles[is.rare.in.unit == F, .(no.of.records = .N, sp.rich = uniqueN(SciName)), keyby = .(unit)] # without rare species
# Express seasonality as the sine and cosine of the distance in radians from June 21st (longest day of the year)
reptiles[, ':=' (dist.21.June = ifelse(as.integer(as.Date(paste('1970', month(Date), day(Date), sep = '-'))) < 354,
Date - as.Date(paste(year(Date), 6, 21, sep = '-')),
Date - as.Date(paste(year(Date) + 1, 6, 21, sep = '-'))))]
reptiles[, .(max(dist.21.June, na.rm = T), min(dist.21.June, na.rm = T))] # Negative values = all Dates are before June 21st (and after December 21 of the previous year)
## V1 V2
## 1: 157 -89
reptiles[is.na(dist.21.June), sort(unique(Date))] # No missing distances to June 21st
## Date of length 0
reptiles[is.na(dist.21.June)] # should be an empty data.table
## Empty data.table (0 rows and 67 cols): point_name,site,campaign,year,unit,subunit...
reptiles[, ':=' (dist.21.June.radians = dist.21.June * pi / 182.5, # Convert to radians, one harmonic
dist.21.June.radians.2h = 2*dist.21.June * pi / 182.5)] # same, two harmonics
reptiles[, .(min(dist.21.June), min(dist.21.June.radians), max(dist.21.June), max(dist.21.June.radians))]
## V1 V2 V3 V4
## 1: -89 -1.532064 157 2.70263
unique(reptiles[dist.21.June == min(dist.21.June), .(Date, dist.21.June, dist.21.June.radians)]) # March 2dth (earliest survey Date)
## Date dist.21.June dist.21.June.radians
## 1: 2020-03-24 -89 -1.532064
unique(reptiles[dist.21.June == max(dist.21.June), .(Date, dist.21.June, dist.21.June.radians)]) # November 25th (latest survey Date)
## Date dist.21.June dist.21.June.radians
## 1: 2015-11-25 157 2.70263
reptiles[, ':=' (sin.dist.21.June = sin(dist.21.June.radians), cos.dist.21.June = cos(dist.21.June.radians),
sin.dist.21.June.2h = sin(dist.21.June.radians.2h), cos.dist.21.June.2h = cos(dist.21.June.radians.2h))] # Calculate the sin and cosine of the distance from June 21st
reptiles[is.na(sin.dist.noon) | is.na(sin.dist.21.June), .(unit, Date, site, point_name, ITime)] # Date and time are available, though
## Empty data.table (0 rows and 5 cols): unit,Date,site,point_name,ITime
# Survey dates and times
reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit, campaign, month(Date))]
## unit campaign month no.of.surveys
## 1: Coastal Plain Sands T0 9 6
## 2: Coastal Plain Sands T0 10 21
## 3: Coastal Plain Sands T1 9 12
## 4: Coastal Plain Sands T1 10 24
## 5: Coastal Plain Sands T2 7 9
## 6: Coastal Plain Sands T2 8 27
## 7: Coastal Plain Sands T3 8 27
## 8: Coastal Plain Sands T3 9 8
## 9: Coastal Plain Sands T4 9 27
## 10: Coastal Plain Sands T4 10 9
## 11: Inland Sands T2 6 18
## 12: Inland Sands T2 7 6
## 13: Inland Sands T3 7 18
## 14: Inland Sands T3 8 6
## 15: Inland Sands T4 7 15
## 16: Inland Sands T4 8 9
## 17: Loess Covered Areas in the Northern Negev T0 6 15
## 18: Loess Covered Areas in the Northern Negev T0 7 12
## 19: Loess Covered Areas in the Northern Negev T1 5 13
## 20: Loess Covered Areas in the Northern Negev T1 6 7
## 21: Loess Covered Areas in the Northern Negev T1 7 10
## 22: Loess Covered Areas in the Northern Negev T2 4 10
## 23: Loess Covered Areas in the Northern Negev T2 5 18
## 24: Loess Covered Areas in the Northern Negev T3 6 27
## 25: Mediterranean-Desert Transition Zone T0 4 9
## 26: Mediterranean-Desert Transition Zone T0 5 11
## 27: Mediterranean-Desert Transition Zone T0 6 10
## 28: Mediterranean-Desert Transition Zone T1 4 19
## 29: Mediterranean-Desert Transition Zone T1 5 10
## 30: Mediterranean-Desert Transition Zone T2 4 23
## 31: Mediterranean-Desert Transition Zone T2 5 7
## 32: Mediterranean-Desert Transition Zone T3 3 12
## 33: Mediterranean-Desert Transition Zone T3 4 18
## 34: Planted Conifer Forests T0 7 12
## 35: Planted Conifer Forests T0 8 24
## 36: Planted Conifer Forests T0 9 9
## 37: Planted Conifer Forests T1 5 3
## 38: Planted Conifer Forests T1 6 6
## 39: Planted Conifer Forests T1 7 3
## 40: Planted Conifer Forests T1 9 12
## 41: Planted Conifer Forests T1 10 3
## 42: Planted Conifer Forests T1 11 17
## 43: Planted Conifer Forests T2 4 9
## 44: Planted Conifer Forests T2 5 21
## 45: Planted Conifer Forests T2 6 3
## 46: Planted Conifer Forests T2 7 6
## 47: Planted Conifer Forests T2 8 6
## 48: Planted Conifer Forests T3 4 9
## 49: Planted Conifer Forests T3 5 21
## 50: Planted Conifer Forests T3 6 15
## 51: Planted Conifer Forests T4 4 3
## 52: Planted Conifer Forests T4 5 15
## 53: Planted Conifer Forests T4 6 18
## 54: Planted Conifer Forests T4 7 9
## unit campaign month no.of.surveys
write_excel_csv(reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit, campaign, month(Date))],
'Analysis/No. of surveys per unit, campaign and calendar month.csv')
write_excel_csv(reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit, month(Date))],
'Analysis/No. of surveys per unit and calendar month.csv')
reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit, campaign, round(ITime))]
## unit campaign round no.of.surveys
## 1: Coastal Plain Sands T0 06:00:00 1
## 2: Coastal Plain Sands T0 07:00:00 2
## 3: Coastal Plain Sands T0 08:00:00 5
## 4: Coastal Plain Sands T0 09:00:00 7
## 5: Coastal Plain Sands T0 10:00:00 10
## ---
## 149: Planted Conifer Forests T4 14:00:00 3
## 150: Planted Conifer Forests T4 15:00:00 10
## 151: Planted Conifer Forests T4 16:00:00 5
## 152: Planted Conifer Forests T4 17:00:00 5
## 153: Planted Conifer Forests T4 18:00:00 3
write_excel_csv(reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit, campaign, round(ITime))],
'Analysis/No. of surveys per unit, campaign and rounded hour.csv')
write_excel_csv(reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(unit, round(ITime))],
'Analysis/No. of surveys per unit and rounded hour.csv')
# Species and their traits
species.list <- read_excel('data/Reptile_species_traits.xlsx', sheet = 'to_import') %>% as.data.table()
reptiles[, heb_name := NULL]
reptiles <- merge(reptiles, species.list[, .(SciName, heb_name)], by = 'SciName', all.x = T) # add Hebrew species names
reptiles[is.na(heb_name), sort(unique(SciName))] # 10 species with no Hebrew names
## [1] "Acanthodactylus schreiberi" "Chamaeleo chamaeleon musae"
## [3] "Chamaeleo chamaeleon recticrista" "Eumeces schneideri schneideri"
## [5] "Mediodactylus kotschyi" "Mesalina guttulata"
## [7] "Rhinotyphlops simoni" "Stellagama stellio"
## [9] "Testudo werneri" "Xerotyphlops vermicularis"
reptiles[is.na(SciName), .N] # 48 records with no species
## [1] 67
reptiles[is.na(SciName) & count_individuals > 0, .N] # But none of them have reported any reptiles anyway
## [1] 0
reptiles <- rbind(merge(reptiles[!is.na(SciName)], species.list[!is.na(SciName), .(SciName = old_sciname, heb_name)], by = 'SciName', all.x = T),
reptiles[is.na(SciName)], fill = T) # Add Hebrew names wherever there are any species names
reptiles[, ':=' (heb_name = ifelse(!is.na(heb_name.x), heb_name.x, heb_name.y), heb_name.x = NULL, heb_name.y = NULL)]
reptiles[is.na(heb_name), sort(unique(SciName))] # 7 more species with no Hebrew names
## [1] "Chamaeleo chamaeleon musae" "Chamaeleo chamaeleon recticrista"
## [3] "Stellagama stellio" "Xerotyphlops vermicularis"
reptiles[SciName %in% c('Chamaeleo chamaeleon musae', 'Chamaeleo chamaeleon recticrista'),
':=' (SciName = 'Chamaeleo chamaeleon', heb_name = 'זיקית')]
reptiles[SciName == 'Stellagama stellio', ':=' (SciName = 'Laudakia vulgaris', heb_name = 'חרדון מצוי')]
reptiles[SciName == 'Xerotyphlops vermicularis', ':=' (SciName = 'Xerotyphlops syriacus', heb_name = 'נחשיל מצוי')]
reptiles[SciName == 'Eirenis rothi', ':=' (SciName = 'Eirenis rothii', heb_name = 'שלוון טלוא-ראש')]
reptiles[SciName == 'Eumeces schneideri', ':=' (SciName = 'Eumeces schneiderii', heb_name = 'חומט מנומר')]
reptiles[SciName == 'Laudakia stellio', ':=' (SciName = 'Laudakia vulgaris', heb_name = 'חרדון מצוי')]
reptiles[is.na(heb_name), sort(unique(SciName))] # No more species with no Hebrew names
## character(0)
reptiles[, .(no.of.Heb_names = uniqueN(heb_name)), keyby = SciName][no.of.Heb_names > 1] # No species with multiple Hebrew names
## Empty data.table (0 rows and 2 cols): SciName,no.of.Heb_names
reptiles[, .(no.of.Sci_names = uniqueN(SciName)), keyby = SciName][no.of.Sci_names > 1] # No species with multiple scientific names
## Empty data.table (0 rows and 2 cols): SciName,no.of.Sci_names
reptiles[!SciName %in% species.list$SciName, unique(SciName)] # species missing in the official species list
## [1] "Acanthodactylus schreiberi" "Eumeces schneideri schneideri"
## [3] "Mediodactylus kotschyi" "Mesalina guttulata"
## [5] "Rhinotyphlops simoni" "Testudo werneri"
## [7] NA
reptiles[SciName == 'Acanthodactylus schreiberi', SciName := 'Acanthodactylus boskianus']
reptiles[SciName == 'Eumeces schneideri schneideri', SciName := 'Eumeces schneiderii']
reptiles[SciName == 'Mediodactylus kotschyi', SciName := 'Mediodactylus orientalis']
reptiles[SciName == 'Mesalina guttulata', SciName := 'Mesalina bahaeldini']
reptiles[SciName == 'Rhinotyphlops simoni', SciName := 'Letheobia simoni']
reptiles[SciName == 'Testudo werneri', SciName := 'Testudo kleinmanni']
reptiles[SciName == 'Malpolon monspessulanus', SciName := 'Malpolon insignitus']
reptiles[SciName == 'Trachylepis vittata', SciName := 'Heremites vittatus']
reptiles[!SciName %in% species.list$SciName, unique(SciName)] # No more species missing in the official species list
## [1] NA
reptiles[is.na(SciName), sort(unique(heb_name))]
## character(0)
reptiles[is.na(SciName) & !is.na(heb_name)] # All records without a scientific name also have no Hebrew names
## Empty data.table (0 rows and 73 cols): SciName,point_name,site,campaign,year,unit...
reptiles[is.na(SciName), sort(unique(count_individuals))] # Missing scientific names are always zero counts
## [1] 0
# Temperature
reptiles[is.na(temp_sun) & is.na(temp_shade), .N] # 969 records with no temperature data
## [1] 973
reptiles[is.na(temp_sun) & is.na(temp_shade), .N, keyby = .(unit)] # fairly evenly spread
## unit N
## 1: Coastal Plain Sands 266
## 2: Inland Sands 75
## 3: Loess Covered Areas in the Northern Negev 195
## 4: Mediterranean-Desert Transition Zone 200
## 5: Planted Conifer Forests 237
surveys.with.sun_temp <- reptiles[!is.na(temp_sun), .(survey_ID = unique(survey_ID)), keyby = .(campaign, unit)]
reptiles[survey_ID %in% surveys.with.sun_temp$survey_ID, uniqueN(survey_ID)] # 431 surveys with sun temperature
## [1] 380
reptiles[!survey_ID %in% surveys.with.sun_temp$survey_ID, uniqueN(survey_ID)] # 300 surveys without sun temperature
## [1] 317
reptiles[!survey_ID %in% surveys.with.sun_temp$survey_ID, uniqueN(survey_ID), keyby = unit] # surveys without temperature data are prevalent
## unit V1
## 1: Coastal Plain Sands 65
## 2: Inland Sands 7
## 3: Loess Covered Areas in the Northern Negev 67
## 4: Mediterranean-Desert Transition Zone 65
## 5: Planted Conifer Forests 113
# Alas, temperature cannot be used as a predictor due to many surveys that lack it
quantile(reptiles[, temp_shade], na.rm = T) # from 14 to 42.5 degrees
## 0% 25% 50% 75% 100%
## 14.0 25.2 28.8 31.4 42.5
quantile(reptiles[, temp_sun], na.rm = T) # 511.0 degrees make no sense!
## 0% 25% 50% 75% 100%
## 18.4 31.0 39.0 45.0 511.0
reptiles[temp_sun == 511, temp_sun := 51.1] # 51.1 is still an extreme temperature, but it makes more sense
reptiles[, ':=' (scaled.temp.shade = scale(temp_shade), scaled.temp.sun = scale(temp_sun))] # Scale predictors
GGally::ggpairs(reptiles[, .(scaled.temp.shade, scaled.temp.sun)])
## Registered S3 method overwritten by 'GGally':
## method from
## +.gg ggplot2
## Warning: Removed 973 rows containing non-finite values (`stat_density()`).
## Warning in ggally_statistic(data = data, mapping = mapping, na.rm = na.rm, :
## Removed 973 rows containing missing values
## Warning: Removed 973 rows containing missing values (`geom_point()`).
## Warning: Removed 973 rows containing non-finite values (`stat_density()`).
# obviously, the two temperature measures are highly and significantly correlated (0.703)
# Number of stones:
reptiles[, sort(unique(stones_flipped))] # From zero to 240 stones
## [1] 0 1 2 4 5 9 10 15 20 25 30 35 36 40 45 50 55 60 65
## [20] 70 75 80 85 90 95 100 110 120 130 135 140 145 150 155 160 170 175 180
## [39] 190 200 210 220 230 240
reptiles[, uniqueN(stones_flipped), keyby = survey_ID][V1 != 1] # Sanity check: empty data.table = only one number of stones flipped per survey
## Empty data.table (0 rows and 2 cols): survey_ID,V1
reptiles[(unit %like% 'Coast' | unit %like% 'Sand'), sort(unique(stones_flipped)), keyby = survey_ID][is.na(V1)]
## Empty data.table (0 rows and 2 cols): survey_ID,V1
reptiles[!(unit %like% 'Coast' | unit %like% 'Sand'), sort(unique(stones_flipped)), keyby = survey_ID]
## survey_ID V1
## 1: T2_Aderet 31.67144877_34.9880248 75
## 2: T2_Aderet 31.67577723_34.98668826 90
## 3: T2_Aderet 31.67867469_34.98154177 75
## 4: T2_Amatzia 31.50751869_34.8949584 110
## 5: T2_Amatzia 31.51244719_34.89349107 60
## ---
## 217: T4_Ramat Hashofet Kkl Plantings 4a 70
## 218: T4_Ramot Naftali Kkl Plantings 1 45
## 219: T4_Ramot Naftali Kkl Plantings 2 60
## 220: T4_Ramot Naftali Kkl Plantings 3 50
## 221: T4_Zuriel 33.01091098_35.31488335 60
reptiles[!(unit %like% 'Coast' | unit %like% 'Sand'), sort(unique(stones_flipped)), keyby = survey_ID][is.na(V1)] # no missing numbers of stones flipped
## Empty data.table (0 rows and 2 cols): survey_ID,V1
bla <- merge(reptiles, reptiles[!is.na(stones_flipped), sort(unique(stones_flipped)), keyby = survey_ID], by = 'survey_ID', all.x = T)
bla[V1 != stones_flipped] # sanity check
## Empty data.table (0 rows and 76 cols): survey_ID,SciName,point_name,site,campaign,year...
bla[stones_flipped != V1]
## Empty data.table (0 rows and 76 cols): survey_ID,SciName,point_name,site,campaign,year...
bla[!(unit %like% 'Sand' | unit %like% 'Coast'), .N, keyby = .(stones.flipped.known = !survey_ID %in% bla[is.na(V1), unique(survey_ID)])]
## stones.flipped.known N
## 1: FALSE 600
## 2: TRUE 620
# only 598 surveys have information about the number of stones flipped (580 surveys have no such info)
hist(reptiles[!(unit %like% 'Coast' | unit %like% 'Sand'), sort(unique(stones_flipped)), keyby = survey_ID][, V1]) # Peak at 50-100 stones; about 30 surveys with fewer than 30 stones
reptiles[!(unit %like% 'Coast' | unit %like% 'Sand'), sort(unique(stones_flipped)), keyby = survey_ID][V1 < 30, .N]
## [1] 18
## Abundance corrections
# Indirect observations abundance should be set to 1
# convert all "tracks" observations to a single observation per plot-year-species combination,
# with an individual count of 1
# first reduce multiple track observation of the same species from the same year-plot to a
# single observation
reptiles[activity=="tracks",`:=`(track_obs_id=seq_len(.N),grp_id = .GRP),by=.(survey_ID,SciName)]
reptiles.backup <- copy(reptiles) # Back up the data.table before removing "excessive" observations in field signs of species' presence
reptiles <- reptiles[track_obs_id==1 | is.na(track_obs_id)]
# now convert count of individuals to 1 in all observations of tracks
reptiles[track_obs_id==1,count_individuals:=1]
# convert all "eggs" observations to a single observation per plot-year-species combination,
# with an individual count of 1
# first reduce multiple observation of the same species from the same year-plot to a
# single observation
reptiles[activity=="eggs",`:=`(track_obs_id=seq_len(.N),grp_id = .GRP),by=.(survey_ID,SciName)]
reptiles <- reptiles[track_obs_id==1 | is.na(track_obs_id)]
# now convert count of individuals to 1 in all observations
reptiles[track_obs_id==1,count_individuals:=1]
# convert all "eggshell" observations to a single observation per plot-year-species combination,
# with an individual count of 1
# first reduce multiple observation of the same species from the same year-plot to a
# single observation
reptiles[activity=="eggshell",`:=`(track_obs_id=seq_len(.N),grp_id = .GRP),by=.(survey_ID,SciName)]
reptiles <- reptiles[track_obs_id==1 | is.na(track_obs_id)]
# now convert count of individuals to 1 in all observations
reptiles[track_obs_id==1,count_individuals:=1]
# Observations in over 10 individuals should be set to 1
reptiles[count_individuals > 9, .N] # 3 such records
## [1] 3
reptiles[count_individuals > 9, count_individuals := 1]
# convert all character vectors to factors
changeCols <- colnames(reptiles)[which(as.data.table(as.vector(reptiles[,lapply(.SD, class)]))[1,]=="character")]
reptiles[,(changeCols):= lapply(.SD, as.factor), .SDcols = changeCols]
unit_names <- sort(unique(reptiles$unit))
# Convert to wide format (cast):
str(reptiles)
## Classes 'data.table' and 'data.frame': 2718 obs. of 77 variables:
## $ SciName : Factor w/ 52 levels "Ablepharus rueppellii",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 76 80 82 82 84 84 96 136 136 136 ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 9 10 10 10 10 10 12 18 18 18 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 5 5 5 5 5 5 5 5 5 5 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: 3 1 1 1 1 1 3 1 1 1 ...
## $ settlements : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: NA NA NA NA NA NA NA NA NA NA ...
## $ observations_id : Factor w/ 428 levels "","00096fb4-2975-409e-8130-d3fb412e27b7",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ latitude : num 31.8 32.7 32.7 32.7 32.7 ...
## $ longitude : num 35.1 35.1 35.1 35.1 35.1 ...
## $ date : Factor w/ 123 levels "01/05/2019","01/06/2020",..: 50 90 90 90 90 90 47 7 7 7 ...
## $ time : Factor w/ 520 levels "10:00:00","10:01:00",..: 77 111 30 39 62 68 64 23 26 27 ...
## $ date_end : Factor w/ 8 levels "","08/07/2021",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ time_end : Factor w/ 53 levels "","10:09","10:10",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ activity : Factor w/ 15 levels "basking","burrowing",..: 8 8 8 8 8 11 8 8 8 8 ...
## $ orientation : Factor w/ 6 levels "between","in",..: 1 1 1 1 1 6 1 1 1 1 ...
## $ type : Factor w/ 35 levels "Acacia","annuals",..: 27 16 16 16 16 23 16 16 16 16 ...
## $ body : int NA NA NA NA NA NA NA NA NA NA ...
## $ tail : Factor w/ 38 levels "100","105","13",..: NA NA NA NA NA NA NA NA NA NA ...
## $ tail_type : Factor w/ 5 levels "broken","original",..: NA NA NA NA NA 2 2 2 2 2 ...
## $ stones_flipped : int NA NA NA NA NA NA NA NA NA NA ...
## $ weather : Factor w/ 28 levels "","אובך","בהיר וחם",..: NA NA NA NA NA NA NA NA NA NA ...
## $ temp_shade : num NA NA NA NA NA NA NA NA NA NA ...
## $ temp_sun : num NA NA NA NA NA NA NA NA NA NA ...
## $ site_description : Factor w/ 9 levels "","גזם אורנים מתים טרם פונה. נבירות חזירי בר",..: NA NA NA NA NA NA NA NA NA NA ...
## $ obs_snout_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ obs_tail_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ obs_regentail_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ material : Factor w/ 15 levels "","annuals","bark (tree)",..: NA NA NA NA NA NA NA NA NA NA ...
## $ obs_notes : Factor w/ 107 levels "","אורך פסיעה 16 ס''מ",..: NA NA NA NA NA NA NA NA NA NA ...
## $ disturbance : Factor w/ 36 levels "","אשפה, גרוטאות, ערימות חציר",..: NA NA NA NA NA NA NA NA NA NA ...
## $ sv : int NA NA NA NA NA NA NA NA NA NA ...
## $ t : int NA NA NA NA NA NA NA NA NA NA ...
## $ regen_t : num NA NA NA NA NA NA NA NA NA NA ...
## $ substrate : Factor w/ 18 levels "","annuals","bark (tree)",..: NA NA NA NA NA NA NA NA NA NA ...
## $ survey_protocol : Factor w/ 3 levels "scan","trail",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ count_individuals : num 1 1 1 1 1 1 1 1 1 1 ...
## $ weather_desc : Factor w/ 7 levels "","clear","cloudy",..: NA NA NA NA NA NA NA NA NA NA ...
## $ wind : Factor w/ 4 levels "","light","medium",..: NA NA NA NA NA NA NA NA NA NA ...
## $ sex_new : Factor w/ 3 levels "","female","male": NA NA NA NA NA NA NA NA NA NA ...
## $ age : Factor w/ 5 levels "","adult","juvenile",..: NA 3 NA NA NA 3 3 3 3 3 ...
## $ observation_type : Factor w/ 2 levels "direct","indirect": 1 1 1 1 1 1 1 1 1 1 ...
## $ Column : Factor w/ 7 levels "adult","female",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lat : num 31.8 32.7 32.7 32.7 32.7 ...
## $ mean.lon : num 35.1 35.1 35.1 35.1 35.1 ...
## $ conc_lat_lon : Factor w/ 258 levels "30.915613_34.446467",..: 192 226 228 228 230 230 196 216 216 216 ...
## $ Date : Date, format: "2014-08-11" "2014-07-22" ...
## $ ITime : 'ITime' int 10:33:00 11:17:00 09:39:00 09:39:00 10:17:00 10:17:00 10:19:00 09:27:00 09:27:00 09:27:00 ...
## $ start_Time : 'ITime' int 11:33:00 12:17:00 10:39:00 10:39:00 11:17:00 11:17:00 11:19:00 10:27:00 10:27:00 10:27:00 ...
## $ Date.time : POSIXct, format: "2014-08-11 10:33:00" "2014-07-22 11:17:00" ...
## $ Comments : Factor w/ 5 levels "Coordinates taken from T1 2016 data",..: NA NA NA NA NA NA NA NA NA NA ...
## $ new_plot_id : Factor w/ 168 levels "Aderet 31.67144877_34.9880248",..: 31 34 36 36 38 38 44 NA NA NA ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 36 37 38 38 39 39 44 62 62 62 ...
## $ Occurrence : num NA NA NA NA NA NA NA NA NA NA ...
## $ dist.noon : num 5220 2580 8460 8460 6180 6180 6060 9180 9180 9180 ...
## $ dist.noon.radians : num 0.38 0.188 0.615 0.615 0.449 ...
## $ dist.noon.radians.2h : num 0.759 0.375 1.23 1.23 0.899 ...
## $ sin.dist.noon : num 0.371 0.187 0.577 0.577 0.434 ...
## $ cos.dist.noon : num 0.929 0.982 0.817 0.817 0.901 ...
## $ sin.dist.noon.2h : num 0.688 0.367 0.943 0.943 0.783 ...
## $ cos.dist.noon.2h : num 0.725 0.93 0.334 0.334 0.623 ...
## $ dist.21.June : num 51 31 31 31 31 31 50 72 72 72 ...
## $ dist.21.June.radians : num 0.878 0.534 0.534 0.534 0.534 ...
## $ dist.21.June.radians.2h: num 1.76 1.07 1.07 1.07 1.07 ...
## $ sin.dist.21.June : num 0.769 0.509 0.509 0.509 0.509 ...
## $ cos.dist.21.June : num 0.639 0.861 0.861 0.861 0.861 ...
## $ sin.dist.21.June.2h : num 0.983 0.876 0.876 0.876 0.876 ...
## $ cos.dist.21.June.2h : num -0.184 0.483 0.483 0.483 0.483 ...
## $ heb_name : Factor w/ 52 levels "ארבע-קו מובהק",..: 7 7 7 7 7 7 7 7 7 7 ...
## $ scaled.temp.shade : num NA NA NA NA NA NA NA NA NA NA ...
## ..- attr(*, "scaled:center")= num 28.3
## ..- attr(*, "scaled:scale")= num 4.64
## $ scaled.temp.sun : num NA NA NA NA NA NA NA NA NA NA ...
## ..- attr(*, "scaled:center")= num 38.6
## ..- attr(*, "scaled:scale")= num 9
## $ track_obs_id : int NA NA NA NA NA NA NA NA NA NA ...
## $ grp_id : int NA NA NA NA NA NA NA NA NA NA ...
## - attr(*, ".internal.selfref")=<externalptr>
## - attr(*, "index")= int(0)
## ..- attr(*, "__track_obs_id")= int [1:2718] 1 2 3 4 5 6 7 8 9 10 ...
# Define the left hand side (LHS) of the casting function (i.e. the variables defining the survey event itself rather than species found in the survey = the identity variables):
LHS <- c('unit', 'year','campaign', 'subunit', 'site', 'point_name','survey_ID', 'Date', 'sin.dist.21.June','cos.dist.21.June',
'sin.dist.noon','cos.dist.noon','settlements','agriculture','dunes','habitat','mean.lon','mean.lat')
# Cast the data according to the left hand side (the identity variables):
rept_cast <- dcast.data.table(reptiles,as.formula(paste(paste(LHS, collapse = "+"), "~ SciName")),
fun.aggregate = sum, value.var = "count_individuals")
str(rept_cast)
## Classes 'data.table' and 'data.frame': 697 obs. of 71 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 3 3 3 3 3 3 3 3 3 4 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 12 13 14 15 16 17 18 19 20 21 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 7 8 9 10 11 12 13 14 15 16 ...
## $ Date : Date, format: "2014-09-30" "2014-09-30" ...
## $ sin.dist.21.June : num 0.986 0.986 0.986 0.986 0.986 ...
## $ cos.dist.21.June : num -0.167 -0.167 -0.167 -0.167 -0.167 ...
## $ sin.dist.noon : num 0.758 0.383 0.679 0.609 0.548 ...
## $ cos.dist.noon : num 0.653 0.924 0.734 0.793 0.836 ...
## $ settlements : Factor w/ 2 levels "Far","Near": 1 1 1 1 1 1 2 2 2 1 ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: 1 1 1 2 2 2 1 1 1 1 ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num 34.6 34.6 34.6 34.6 34.6 ...
## $ mean.lat : num 31.8 31.8 31.8 31.8 31.8 ...
## $ NA : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Ablepharus rueppellii : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Acanthodactylus aegyptius : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Acanthodactylus beershebensis: num 0 0 0 0 0 0 0 0 0 0 ...
## $ Acanthodactylus boskianus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Acanthodactylus scutellatus : num 4 3 15 2 4 2 2 2 1 4 ...
## $ Cerastes cerastes : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Cerastes vipera : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Chalcides guentheri : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Chalcides ocellatus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Chalcides sepsoides : num 1 1 1 1 1 1 1 1 1 1 ...
## $ Chamaeleo chamaeleon : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Daboia palaestinae : num 0 0 0 0 0 1 0 0 0 0 ...
## $ Dolichophis jugularis : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Eirenis coronelloides : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Eirenis decemlineatus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Eirenis rothii : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Eryx jaculus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Eumeces schneiderii : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Hemidactylus turcicus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Hemorrhois nummifer : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Heremites vittatus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Laudakia vulgaris : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Letheobia simoni : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Lytorhynchus diadema : num 0 0 0 0 0 0 0 0 0 1 ...
## $ Macroprotodon cucullatus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Malpolon insignitus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Mediodactylus orientalis : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Mesalina bahaeldini : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Mesalina olivieri : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Micrelaps muelleri : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Myriopholis macrorhyncha : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Ophiomorus latastii : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Ophisops elegans : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Phoenicolacerta laevis : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Platyceps collaris : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Platyceps rogersi : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Psammophis schokari : num 0 0 0 0 0 0 0 0 2 1 ...
## $ Pseudopus apodus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Ptyodactylus guttatus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Ptyodactylus puiseuxi : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Rhynchocalamus melanocephalus: num 0 0 0 0 0 0 0 0 0 0 ...
## $ Scincus scincus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Spalerosophis diadema : num 0 1 0 0 0 0 1 0 0 0 ...
## $ Stenodactylus petrii : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Stenodactylus sthenodactylus : num 1 2 1 2 1 2 1 1 1 1 ...
## $ Telescopus fallax : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Testudo graeca : num 0 0 0 0 0 0 0 0 0 1 ...
## $ Testudo kleinmanni : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Trapelus agnetae : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Trapelus savignii : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Varanus griseus : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Xerotyphlops syriacus : num 0 0 0 0 0 0 0 0 0 0 ...
## - attr(*, ".internal.selfref")=<externalptr>
## - attr(*, "sorted")= chr [1:18] "unit" "year" "campaign" "subunit" ...
names(rept_cast)
## [1] "unit" "year"
## [3] "campaign" "subunit"
## [5] "site" "point_name"
## [7] "survey_ID" "Date"
## [9] "sin.dist.21.June" "cos.dist.21.June"
## [11] "sin.dist.noon" "cos.dist.noon"
## [13] "settlements" "agriculture"
## [15] "dunes" "habitat"
## [17] "mean.lon" "mean.lat"
## [19] "NA" "Ablepharus rueppellii"
## [21] "Acanthodactylus aegyptius" "Acanthodactylus beershebensis"
## [23] "Acanthodactylus boskianus" "Acanthodactylus scutellatus"
## [25] "Cerastes cerastes" "Cerastes vipera"
## [27] "Chalcides guentheri" "Chalcides ocellatus"
## [29] "Chalcides sepsoides" "Chamaeleo chamaeleon"
## [31] "Daboia palaestinae" "Dolichophis jugularis"
## [33] "Eirenis coronelloides" "Eirenis decemlineatus"
## [35] "Eirenis rothii" "Eryx jaculus"
## [37] "Eumeces schneiderii" "Hemidactylus turcicus"
## [39] "Hemorrhois nummifer" "Heremites vittatus"
## [41] "Laudakia vulgaris" "Letheobia simoni"
## [43] "Lytorhynchus diadema" "Macroprotodon cucullatus"
## [45] "Malpolon insignitus" "Mediodactylus orientalis"
## [47] "Mesalina bahaeldini" "Mesalina olivieri"
## [49] "Micrelaps muelleri" "Myriopholis macrorhyncha"
## [51] "Ophiomorus latastii" "Ophisops elegans"
## [53] "Phoenicolacerta laevis" "Platyceps collaris"
## [55] "Platyceps rogersi" "Psammophis schokari"
## [57] "Pseudopus apodus" "Ptyodactylus guttatus"
## [59] "Ptyodactylus puiseuxi" "Rhynchocalamus melanocephalus"
## [61] "Scincus scincus" "Spalerosophis diadema"
## [63] "Stenodactylus petrii" "Stenodactylus sthenodactylus"
## [65] "Telescopus fallax" "Testudo graeca"
## [67] "Testudo kleinmanni" "Trapelus agnetae"
## [69] "Trapelus savignii" "Varanus griseus"
## [71] "Xerotyphlops syriacus"
rept_cast.abnd <- rept_cast[, 23:length(rept_cast)] # Subset only the species' fields as the response variables
rept_cast.abnd <- as.matrix(rept_cast.abnd) # Convert to matrix for gllvm
rept.env <- as.data.table(rept_cast[, 1:20]) # subset the environmental predictors of the reptiles data
str(rept.env)
## Classes 'data.table' and 'data.frame': 697 obs. of 20 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 3 3 3 3 3 3 3 3 3 4 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 12 13 14 15 16 17 18 19 20 21 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 7 8 9 10 11 12 13 14 15 16 ...
## $ Date : Date, format: "2014-09-30" "2014-09-30" ...
## $ sin.dist.21.June : num 0.986 0.986 0.986 0.986 0.986 ...
## $ cos.dist.21.June : num -0.167 -0.167 -0.167 -0.167 -0.167 ...
## $ sin.dist.noon : num 0.758 0.383 0.679 0.609 0.548 ...
## $ cos.dist.noon : num 0.653 0.924 0.734 0.793 0.836 ...
## $ settlements : Factor w/ 2 levels "Far","Near": 1 1 1 1 1 1 2 2 2 1 ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: 1 1 1 2 2 2 1 1 1 1 ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num 34.6 34.6 34.6 34.6 34.6 ...
## $ mean.lat : num 31.8 31.8 31.8 31.8 31.8 ...
## $ NA : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Ablepharus rueppellii: num 0 0 0 0 0 0 0 0 0 0 ...
## - attr(*, ".internal.selfref")=<externalptr>
## - attr(*, "sorted")= chr [1:18] "unit" "year" "campaign" "subunit" ...
write_excel_csv(rept_cast, file = 'Output/Basic matrix - plots-campaign rows, species columns - individual counts.csv')
Here we will generate and export basic data incidence matrix.
# setwd('C:/Users/User/OneDrive - Tel-Aviv University/Maarag/State of Nature Report/2023/Reptiles') # Change this to your file path
### 4. Incidence matrix----
reptiles[, Occurrence := ifelse(count_individuals > 0, 1, 0)]
rept.incidence <- dcast(reptiles[count_individuals > 0], as.formula(paste(paste(LHS, collapse = "+"), "~ SciName")),
value.var = 'Occurrence', fun.aggregate = mean)
bla <- as.data.frame(rept.incidence)
bla[is.na(bla)] <- 0
## Warning in `[<-.factor`(`*tmp*`, thisvar, value = 0): invalid factor level, NA
## generated
## Warning in `[<-.factor`(`*tmp*`, thisvar, value = 0): invalid factor level, NA
## generated
## Warning in `[<-.factor`(`*tmp*`, thisvar, value = 0): invalid factor level, NA
## generated
## Warning in `[<-.factor`(`*tmp*`, thisvar, value = 0): invalid factor level, NA
## generated
## Warning in `[<-.factor`(`*tmp*`, thisvar, value = 0): invalid factor level, NA
## generated
rept.incidence <- bla
rm(bla)
any(rept.incidence[, 21:length(rept.incidence)] > 1) # are any incidence values greater then 1? This should be FALSE
## [1] FALSE
# too.many.incidences <- rept.incidence %>% filter(if_any(all_of(names(rept.incidence[, 21:length(rept.incidence)])), ~ . > 1))
rept.incidence <- as.data.table(rept.incidence)
rept.incidence
## unit year campaign subunit site
## 1: Coastal Plain Sands 2014 T0 <NA> Ashdod
## 2: Coastal Plain Sands 2014 T0 <NA> Ashdod
## 3: Coastal Plain Sands 2014 T0 <NA> Ashdod
## 4: Coastal Plain Sands 2014 T0 <NA> Ashdod
## 5: Coastal Plain Sands 2014 T0 <NA> Ashdod
## ---
## 626: Planted Conifer Forests 2021 T4 Judean Highlands Eshtaol
## 627: Planted Conifer Forests 2021 T4 Judean Highlands Eshtaol
## 628: Planted Conifer Forests 2021 T4 Judean Highlands Givat Yeshayahu
## 629: Planted Conifer Forests 2021 T4 Judean Highlands Givat Yeshayahu
## 630: Planted Conifer Forests 2021 T4 Judean Highlands Givat Yeshayahu
## point_name survey_ID
## 1: Ashdod Far Semi-Shifting 1 T0_Ashdod Far Semi-Shifting 1
## 2: Ashdod Far Semi-Shifting 2 T0_Ashdod Far Semi-Shifting 2
## 3: Ashdod Far Semi-Shifting 3 T0_Ashdod Far Semi-Shifting 3
## 4: Ashdod Far Shifting 1 T0_Ashdod Far Shifting 1
## 5: Ashdod Far Shifting 2 T0_Ashdod Far Shifting 2
## ---
## 626: Eshtaol Kkl Plantings 3 T4_Eshtaol Kkl Plantings 3
## 627: Eshtaol Kkl Plantings 4 T4_Eshtaol Kkl Plantings 4
## 628: Givat Yeshaayahu Kkl Plantings 1 T4_Givat Yeshaayahu Kkl Plantings 1
## 629: Givat Yeshaayahu Kkl Plantings 2 T4_Givat Yeshaayahu Kkl Plantings 2
## 630: Givat Yeshaayahu Kkl Plantings 3 T4_Givat Yeshaayahu Kkl Plantings 3
## Date sin.dist.21.June cos.dist.21.June sin.dist.noon cos.dist.noon
## 1: 2014-09-30 0.9859481 -0.1670516 0.75756498 0.6527598
## 2: 2014-09-30 0.9859481 -0.1670516 0.38268343 0.9238795
## 3: 2014-09-30 0.9859481 -0.1670516 0.67880075 0.7343225
## 4: 2014-09-30 0.9859481 -0.1670516 0.60876143 0.7933533
## 5: 2014-09-30 0.9859481 -0.1670516 0.54829323 0.8362862
## ---
## 626: 2021-04-08 -0.9562348 0.2926003 0.60876143 0.7933533
## 627: 2021-04-08 -0.9562348 0.2926003 0.46947156 0.8829476
## 628: 2021-05-26 -0.4327756 0.9015017 -0.04361939 0.9990482
## 629: 2021-05-26 -0.4327756 0.9015017 0.08715574 0.9961947
## 630: 2021-05-26 -0.4327756 0.9015017 -0.22495105 0.9743701
## settlements agriculture dunes habitat mean.lon mean.lat
## 1: Far <NA> semi-shifting <NA> 34.61184 31.75179
## 2: Far <NA> semi-shifting <NA> 34.63104 31.75970
## 3: Far <NA> semi-shifting <NA> 34.61867 31.76023
## 4: Far <NA> shifting <NA> 34.62451 31.75772
## 5: Far <NA> shifting <NA> 34.62451 31.75975
## ---
## 626: <NA> <NA> <NA> <NA> 35.02194 31.78694
## 627: <NA> <NA> <NA> <NA> 35.02057 31.78378
## 628: <NA> <NA> <NA> <NA> 34.92066 31.67044
## 629: <NA> <NA> <NA> <NA> 34.92544 31.66774
## 630: <NA> <NA> <NA> <NA> 34.91740 31.66540
## Ablepharus rueppellii Acanthodactylus aegyptius
## 1: 0 0
## 2: 0 0
## 3: 0 0
## 4: 0 0
## 5: 0 0
## ---
## 626: 1 0
## 627: 0 0
## 628: 0 0
## 629: 0 0
## 630: 1 0
## Acanthodactylus beershebensis Acanthodactylus boskianus
## 1: 0 0
## 2: 0 0
## 3: 0 0
## 4: 0 0
## 5: 0 0
## ---
## 626: 0 0
## 627: 0 0
## 628: 0 0
## 629: 0 0
## 630: 0 0
## Acanthodactylus scutellatus Cerastes cerastes Cerastes vipera
## 1: 1 0 0
## 2: 1 0 0
## 3: 1 0 0
## 4: 1 0 0
## 5: 1 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Chalcides guentheri Chalcides ocellatus Chalcides sepsoides
## 1: 0 0 1
## 2: 0 0 1
## 3: 0 0 1
## 4: 0 0 1
## 5: 0 0 1
## ---
## 626: 0 0 0
## 627: 1 1 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Chamaeleo chamaeleon Daboia palaestinae Dolichophis jugularis
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 1 0 0
## 629: 0 0 0
## 630: 0 0 0
## Eirenis coronelloides Eirenis decemlineatus Eirenis rothii Eryx jaculus
## 1: 0 0 0 0
## 2: 0 0 0 0
## 3: 0 0 0 0
## 4: 0 0 0 0
## 5: 0 0 0 0
## ---
## 626: 0 0 0 0
## 627: 0 0 0 0
## 628: 0 0 0 0
## 629: 0 0 0 0
## 630: 0 0 0 0
## Eumeces schneiderii Hemidactylus turcicus Hemorrhois nummifer
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Heremites vittatus Laudakia vulgaris Letheobia simoni Lytorhynchus diadema
## 1: 0 0 0 0
## 2: 0 0 0 0
## 3: 0 0 0 0
## 4: 0 0 0 0
## 5: 0 0 0 0
## ---
## 626: 0 0 0 0
## 627: 0 0 0 0
## 628: 0 0 0 0
## 629: 0 0 0 0
## 630: 0 0 0 0
## Macroprotodon cucullatus Malpolon insignitus Mediodactylus orientalis
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 1
## 627: 0 0 1
## 628: 0 0 0
## 629: 0 0 1
## 630: 0 0 0
## Mesalina bahaeldini Mesalina olivieri Micrelaps muelleri
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Myriopholis macrorhyncha Ophiomorus latastii Ophisops elegans
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Phoenicolacerta laevis Platyceps collaris Platyceps rogersi
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Psammophis schokari Pseudopus apodus Ptyodactylus guttatus
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Ptyodactylus puiseuxi Rhynchocalamus melanocephalus Scincus scincus
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Spalerosophis diadema Stenodactylus petrii Stenodactylus sthenodactylus
## 1: 0 0 1
## 2: 1 0 1
## 3: 0 0 1
## 4: 0 0 1
## 5: 0 0 1
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
## Telescopus fallax Testudo graeca Testudo kleinmanni Trapelus agnetae
## 1: 0 0 0 0
## 2: 0 0 0 0
## 3: 0 0 0 0
## 4: 0 0 0 0
## 5: 0 0 0 0
## ---
## 626: 0 0 0 0
## 627: 0 0 0 0
## 628: 0 0 0 0
## 629: 0 0 0 0
## 630: 0 0 0 0
## Trapelus savignii Varanus griseus Xerotyphlops syriacus
## 1: 0 0 0
## 2: 0 0 0
## 3: 0 0 0
## 4: 0 0 0
## 5: 0 0 0
## ---
## 626: 0 0 0
## 627: 0 0 0
## 628: 0 0 0
## 629: 0 0 0
## 630: 0 0 0
write_excel_csv(rept.incidence, file = 'Output/Reptile incidence table T0-T4.csv')
Although we decided not to exclude rare reptile species from the analyses, I add this here for completeness:
# setwd('C:/Users/User/OneDrive - Tel-Aviv University/Maarag/State of Nature Report/2023/Reptiles') # Change this to your file path
### 5. Define rare species (to be excluded from certain analyses)----
# cutoff for rare species - minimum number of plots in which the species was observed. The key is two plots per campaign containing 30 plots, rounded to the nearest integer.
# an additional cutoff is a minimum of 10 individuals.
# plot numbers are as follows:
reptiles[, .(no.of.plots = uniqueN(point_name), no.of.surveys = uniqueN(survey_ID)), keyby = unit]
## unit no.of.plots no.of.surveys
## 1: Coastal Plain Sands 45 170
## 2: Inland Sands 25 72
## 3: Loess Covered Areas in the Northern Negev 57 112
## 4: Mediterranean-Desert Transition Zone 58 119
## 5: Planted Conifer Forests 100 224
min_plots_cutoff <- reptiles[,.(campaign_num=uniqueN(campaign)), by=unit][order(unit)][,plots_per_camp:= reptiles[,
uniqueN(conc_lat_lon), keyby = unit][, V1]][,cutoff:=round(campaign_num*plots_per_camp/30)][cutoff<10,cutoff:=10]
# First condition: Less than one occurrence per campaign with 30 plots:
reptiles[, uniqueN(conc_lat_lon), keyby = .(unit, campaign)] # There are more than 9 plots per campaign - we need to adjust
## unit campaign V1
## 1: Coastal Plain Sands T0 27
## 2: Coastal Plain Sands T1 36
## 3: Coastal Plain Sands T2 36
## 4: Coastal Plain Sands T3 35
## 5: Coastal Plain Sands T4 36
## 6: Inland Sands T2 24
## 7: Inland Sands T3 24
## 8: Inland Sands T4 24
## 9: Loess Covered Areas in the Northern Negev T0 24
## 10: Loess Covered Areas in the Northern Negev T1 29
## 11: Loess Covered Areas in the Northern Negev T2 26
## 12: Loess Covered Areas in the Northern Negev T3 23
## 13: Mediterranean-Desert Transition Zone T0 28
## 14: Mediterranean-Desert Transition Zone T1 29
## 15: Mediterranean-Desert Transition Zone T2 30
## 16: Mediterranean-Desert Transition Zone T3 30
## 17: Planted Conifer Forests T0 29
## 18: Planted Conifer Forests T1 35
## 19: Planted Conifer Forests T2 39
## 20: Planted Conifer Forests T3 40
## 21: Planted Conifer Forests T4 38
## unit campaign V1
reptiles[, .(no.of.plots = uniqueN(conc_lat_lon)), keyby = .(unit, campaign)][, .(adjusted.min.ind = round(no.of.plots/30*2)), keyby = .(unit,campaign)] # T1's minimum no. of individuals should be 1 and not two
## unit campaign adjusted.min.ind
## 1: Coastal Plain Sands T0 2
## 2: Coastal Plain Sands T1 2
## 3: Coastal Plain Sands T2 2
## 4: Coastal Plain Sands T3 2
## 5: Coastal Plain Sands T4 2
## 6: Inland Sands T2 2
## 7: Inland Sands T3 2
## 8: Inland Sands T4 2
## 9: Loess Covered Areas in the Northern Negev T0 2
## 10: Loess Covered Areas in the Northern Negev T1 2
## 11: Loess Covered Areas in the Northern Negev T2 2
## 12: Loess Covered Areas in the Northern Negev T3 2
## 13: Mediterranean-Desert Transition Zone T0 2
## 14: Mediterranean-Desert Transition Zone T1 2
## 15: Mediterranean-Desert Transition Zone T2 2
## 16: Mediterranean-Desert Transition Zone T3 2
## 17: Planted Conifer Forests T0 2
## 18: Planted Conifer Forests T1 2
## 19: Planted Conifer Forests T2 3
## 20: Planted Conifer Forests T3 3
## 21: Planted Conifer Forests T4 3
## unit campaign adjusted.min.ind
rare.species1 <- reptiles[, .(no.of.occurrences = sum(Occurrence)), keyby = .(unit, campaign, Species = str_replace_all(SciName, '_', ' '))][no.of.occurrences < 2,
.(Species = sort(unique(as.character(Species))), condition1 = 'Fewer than two occurrence per campaign'), keyby = unit]
rare.species1
## unit Species
## 1: Coastal Plain Sands Chamaeleo chamaeleon
## 2: Coastal Plain Sands Eryx jaculus
## 3: Coastal Plain Sands Macroprotodon cucullatus
## 4: Coastal Plain Sands Platyceps collaris
## 5: Coastal Plain Sands Testudo graeca
## 6: Coastal Plain Sands Varanus griseus
## 7: Inland Sands Chalcides ocellatus
## 8: Inland Sands Macroprotodon cucullatus
## 9: Inland Sands Platyceps rogersi
## 10: Inland Sands Testudo kleinmanni
## 11: Loess Covered Areas in the Northern Negev Acanthodactylus beershebensis
## 12: Loess Covered Areas in the Northern Negev Chalcides sepsoides
## 13: Loess Covered Areas in the Northern Negev Dolichophis jugularis
## 14: Loess Covered Areas in the Northern Negev Eirenis coronelloides
## 15: Loess Covered Areas in the Northern Negev Eirenis rothii
## 16: Loess Covered Areas in the Northern Negev Eryx jaculus
## 17: Loess Covered Areas in the Northern Negev Eumeces schneiderii
## 18: Loess Covered Areas in the Northern Negev Hemidactylus turcicus
## 19: Loess Covered Areas in the Northern Negev Heremites vittatus
## 20: Loess Covered Areas in the Northern Negev Malpolon insignitus
## 21: Loess Covered Areas in the Northern Negev Mesalina bahaeldini
## 22: Loess Covered Areas in the Northern Negev Mesalina olivieri
## 23: Loess Covered Areas in the Northern Negev Platyceps rogersi
## 24: Loess Covered Areas in the Northern Negev Ptyodactylus guttatus
## 25: Loess Covered Areas in the Northern Negev Stenodactylus sthenodactylus
## 26: Loess Covered Areas in the Northern Negev Trapelus agnetae
## 27: Mediterranean-Desert Transition Zone Chamaeleo chamaeleon
## 28: Mediterranean-Desert Transition Zone Dolichophis jugularis
## 29: Mediterranean-Desert Transition Zone Eirenis decemlineatus
## 30: Mediterranean-Desert Transition Zone Eirenis rothii
## 31: Mediterranean-Desert Transition Zone Eryx jaculus
## 32: Mediterranean-Desert Transition Zone Hemidactylus turcicus
## 33: Mediterranean-Desert Transition Zone Hemorrhois nummifer
## 34: Mediterranean-Desert Transition Zone Letheobia simoni
## 35: Mediterranean-Desert Transition Zone Malpolon insignitus
## 36: Mediterranean-Desert Transition Zone Micrelaps muelleri
## 37: Mediterranean-Desert Transition Zone Myriopholis macrorhyncha
## 38: Mediterranean-Desert Transition Zone Ophiomorus latastii
## 39: Mediterranean-Desert Transition Zone Platyceps collaris
## 40: Mediterranean-Desert Transition Zone Psammophis schokari
## 41: Mediterranean-Desert Transition Zone Rhynchocalamus melanocephalus
## 42: Mediterranean-Desert Transition Zone Stenodactylus sthenodactylus
## 43: Mediterranean-Desert Transition Zone Telescopus fallax
## 44: Mediterranean-Desert Transition Zone Testudo graeca
## 45: Mediterranean-Desert Transition Zone Xerotyphlops syriacus
## 46: Planted Conifer Forests Chalcides ocellatus
## 47: Planted Conifer Forests Dolichophis jugularis
## 48: Planted Conifer Forests Eirenis rothii
## 49: Planted Conifer Forests Eumeces schneiderii
## 50: Planted Conifer Forests Hemorrhois nummifer
## 51: Planted Conifer Forests Heremites vittatus
## 52: Planted Conifer Forests Malpolon insignitus
## 53: Planted Conifer Forests Platyceps collaris
## 54: Planted Conifer Forests Pseudopus apodus
## 55: Planted Conifer Forests Ptyodactylus guttatus
## 56: Planted Conifer Forests Ptyodactylus puiseuxi
## 57: Planted Conifer Forests Rhynchocalamus melanocephalus
## 58: Planted Conifer Forests Telescopus fallax
## 59: Planted Conifer Forests Testudo graeca
## unit Species
## condition1
## 1: Fewer than two occurrence per campaign
## 2: Fewer than two occurrence per campaign
## 3: Fewer than two occurrence per campaign
## 4: Fewer than two occurrence per campaign
## 5: Fewer than two occurrence per campaign
## 6: Fewer than two occurrence per campaign
## 7: Fewer than two occurrence per campaign
## 8: Fewer than two occurrence per campaign
## 9: Fewer than two occurrence per campaign
## 10: Fewer than two occurrence per campaign
## 11: Fewer than two occurrence per campaign
## 12: Fewer than two occurrence per campaign
## 13: Fewer than two occurrence per campaign
## 14: Fewer than two occurrence per campaign
## 15: Fewer than two occurrence per campaign
## 16: Fewer than two occurrence per campaign
## 17: Fewer than two occurrence per campaign
## 18: Fewer than two occurrence per campaign
## 19: Fewer than two occurrence per campaign
## 20: Fewer than two occurrence per campaign
## 21: Fewer than two occurrence per campaign
## 22: Fewer than two occurrence per campaign
## 23: Fewer than two occurrence per campaign
## 24: Fewer than two occurrence per campaign
## 25: Fewer than two occurrence per campaign
## 26: Fewer than two occurrence per campaign
## 27: Fewer than two occurrence per campaign
## 28: Fewer than two occurrence per campaign
## 29: Fewer than two occurrence per campaign
## 30: Fewer than two occurrence per campaign
## 31: Fewer than two occurrence per campaign
## 32: Fewer than two occurrence per campaign
## 33: Fewer than two occurrence per campaign
## 34: Fewer than two occurrence per campaign
## 35: Fewer than two occurrence per campaign
## 36: Fewer than two occurrence per campaign
## 37: Fewer than two occurrence per campaign
## 38: Fewer than two occurrence per campaign
## 39: Fewer than two occurrence per campaign
## 40: Fewer than two occurrence per campaign
## 41: Fewer than two occurrence per campaign
## 42: Fewer than two occurrence per campaign
## 43: Fewer than two occurrence per campaign
## 44: Fewer than two occurrence per campaign
## 45: Fewer than two occurrence per campaign
## 46: Fewer than two occurrence per campaign
## 47: Fewer than two occurrence per campaign
## 48: Fewer than two occurrence per campaign
## 49: Fewer than two occurrence per campaign
## 50: Fewer than two occurrence per campaign
## 51: Fewer than two occurrence per campaign
## 52: Fewer than two occurrence per campaign
## 53: Fewer than two occurrence per campaign
## 54: Fewer than two occurrence per campaign
## 55: Fewer than two occurrence per campaign
## 56: Fewer than two occurrence per campaign
## 57: Fewer than two occurrence per campaign
## 58: Fewer than two occurrence per campaign
## 59: Fewer than two occurrence per campaign
## condition1
# Second condition: fewer than 10 individuals overall:
species.freq <- reptiles[count_individuals > 0, .(total.no.of.ind = sum(count_individuals)),
keyby = .(unit, heb_name, SciName)] # Species frequencies; originally, 37 species
species.freq # Species frequencies;
## unit heb_name SciName
## 1: Coastal Plain Sands ארבע-קו מובהק Psammophis schokari
## 2: Coastal Plain Sands זיקית Chamaeleo chamaeleon
## 3: Coastal Plain Sands זעמן זיתני Platyceps collaris
## 4: Coastal Plain Sands חנק Eryx jaculus
## 5: Coastal Plain Sands חרדון מצוי Laudakia vulgaris
## ---
## 106: Planted Conifer Forests שחור ראש Rhynchocalamus melanocephalus
## 107: Planted Conifer Forests שלוון טלוא-ראש Eirenis rothii
## 108: Planted Conifer Forests שממית בתים Hemidactylus turcicus
## 109: Planted Conifer Forests שממית עצים Mediodactylus orientalis
## 110: Planted Conifer Forests תלום-קשקשים מצוי Malpolon insignitus
## total.no.of.ind
## 1: 50
## 2: 5
## 3: 1
## 4: 13
## 5: 2
## ---
## 106: 3
## 107: 3
## 108: 38
## 109: 71
## 110: 1
species.freq[, uniqueN(SciName)] # originally, 52 species
## [1] 52
rare.species2 <- species.freq[total.no.of.ind < 10, .(Species = SciName, condition2 = 'Fewer than 10 individuals overall'), keyby = unit]
rare.species2
## unit Species
## 1: Coastal Plain Sands Chamaeleo chamaeleon
## 2: Coastal Plain Sands Platyceps collaris
## 3: Coastal Plain Sands Laudakia vulgaris
## 4: Coastal Plain Sands Varanus griseus
## 5: Coastal Plain Sands Xerotyphlops syriacus
## 6: Coastal Plain Sands Mediodactylus orientalis
## 7: Coastal Plain Sands Acanthodactylus aegyptius
## 8: Coastal Plain Sands Malpolon insignitus
## 9: Inland Sands Psammophis schokari
## 10: Inland Sands Platyceps rogersi
## 11: Inland Sands Trapelus savignii
## 12: Inland Sands Chalcides ocellatus
## 13: Inland Sands Macroprotodon cucullatus
## 14: Inland Sands Testudo kleinmanni
## 15: Loess Covered Areas in the Northern Negev Psammophis schokari
## 16: Loess Covered Areas in the Northern Negev Platyceps rogersi
## 17: Loess Covered Areas in the Northern Negev Dolichophis jugularis
## 18: Loess Covered Areas in the Northern Negev Eumeces schneiderii
## 19: Loess Covered Areas in the Northern Negev Eryx jaculus
## 20: Loess Covered Areas in the Northern Negev Trapelus agnetae
## 21: Loess Covered Areas in the Northern Negev Stenodactylus sthenodactylus
## 22: Loess Covered Areas in the Northern Negev Varanus griseus
## 23: Loess Covered Areas in the Northern Negev Mesalina olivieri
## 24: Loess Covered Areas in the Northern Negev Ptyodactylus guttatus
## 25: Loess Covered Areas in the Northern Negev Chalcides sepsoides
## 26: Loess Covered Areas in the Northern Negev Eirenis coronelloides
## 27: Loess Covered Areas in the Northern Negev Eirenis rothii
## 28: Loess Covered Areas in the Northern Negev Acanthodactylus boskianus
## 29: Loess Covered Areas in the Northern Negev Malpolon insignitus
## 30: Mediterranean-Desert Transition Zone Psammophis schokari
## 31: Mediterranean-Desert Transition Zone Chamaeleo chamaeleon
## 32: Mediterranean-Desert Transition Zone Platyceps collaris
## 33: Mediterranean-Desert Transition Zone Hemorrhois nummifer
## 34: Mediterranean-Desert Transition Zone Dolichophis jugularis
## 35: Mediterranean-Desert Transition Zone Ophiomorus latastii
## 36: Mediterranean-Desert Transition Zone Eryx jaculus
## 37: Mediterranean-Desert Transition Zone Stenodactylus sthenodactylus
## 38: Mediterranean-Desert Transition Zone Micrelaps muelleri
## 39: Mediterranean-Desert Transition Zone Letheobia simoni
## 40: Mediterranean-Desert Transition Zone Xerotyphlops syriacus
## 41: Mediterranean-Desert Transition Zone Myriopholis macrorhyncha
## 42: Mediterranean-Desert Transition Zone Telescopus fallax
## 43: Mediterranean-Desert Transition Zone Rhynchocalamus melanocephalus
## 44: Mediterranean-Desert Transition Zone Eirenis rothii
## 45: Mediterranean-Desert Transition Zone Eirenis decemlineatus
## 46: Mediterranean-Desert Transition Zone Malpolon insignitus
## 47: Planted Conifer Forests Psammophis schokari
## 48: Planted Conifer Forests Chamaeleo chamaeleon
## 49: Planted Conifer Forests Platyceps collaris
## 50: Planted Conifer Forests Hemorrhois nummifer
## 51: Planted Conifer Forests Dolichophis jugularis
## 52: Planted Conifer Forests Eumeces schneiderii
## 53: Planted Conifer Forests Ptyodactylus puiseuxi
## 54: Planted Conifer Forests Ptyodactylus guttatus
## 55: Planted Conifer Forests Chalcides guentheri
## 56: Planted Conifer Forests Telescopus fallax
## 57: Planted Conifer Forests Testudo graeca
## 58: Planted Conifer Forests Pseudopus apodus
## 59: Planted Conifer Forests Rhynchocalamus melanocephalus
## 60: Planted Conifer Forests Eirenis rothii
## 61: Planted Conifer Forests Malpolon insignitus
## unit Species
## condition2
## 1: Fewer than 10 individuals overall
## 2: Fewer than 10 individuals overall
## 3: Fewer than 10 individuals overall
## 4: Fewer than 10 individuals overall
## 5: Fewer than 10 individuals overall
## 6: Fewer than 10 individuals overall
## 7: Fewer than 10 individuals overall
## 8: Fewer than 10 individuals overall
## 9: Fewer than 10 individuals overall
## 10: Fewer than 10 individuals overall
## 11: Fewer than 10 individuals overall
## 12: Fewer than 10 individuals overall
## 13: Fewer than 10 individuals overall
## 14: Fewer than 10 individuals overall
## 15: Fewer than 10 individuals overall
## 16: Fewer than 10 individuals overall
## 17: Fewer than 10 individuals overall
## 18: Fewer than 10 individuals overall
## 19: Fewer than 10 individuals overall
## 20: Fewer than 10 individuals overall
## 21: Fewer than 10 individuals overall
## 22: Fewer than 10 individuals overall
## 23: Fewer than 10 individuals overall
## 24: Fewer than 10 individuals overall
## 25: Fewer than 10 individuals overall
## 26: Fewer than 10 individuals overall
## 27: Fewer than 10 individuals overall
## 28: Fewer than 10 individuals overall
## 29: Fewer than 10 individuals overall
## 30: Fewer than 10 individuals overall
## 31: Fewer than 10 individuals overall
## 32: Fewer than 10 individuals overall
## 33: Fewer than 10 individuals overall
## 34: Fewer than 10 individuals overall
## 35: Fewer than 10 individuals overall
## 36: Fewer than 10 individuals overall
## 37: Fewer than 10 individuals overall
## 38: Fewer than 10 individuals overall
## 39: Fewer than 10 individuals overall
## 40: Fewer than 10 individuals overall
## 41: Fewer than 10 individuals overall
## 42: Fewer than 10 individuals overall
## 43: Fewer than 10 individuals overall
## 44: Fewer than 10 individuals overall
## 45: Fewer than 10 individuals overall
## 46: Fewer than 10 individuals overall
## 47: Fewer than 10 individuals overall
## 48: Fewer than 10 individuals overall
## 49: Fewer than 10 individuals overall
## 50: Fewer than 10 individuals overall
## 51: Fewer than 10 individuals overall
## 52: Fewer than 10 individuals overall
## 53: Fewer than 10 individuals overall
## 54: Fewer than 10 individuals overall
## 55: Fewer than 10 individuals overall
## 56: Fewer than 10 individuals overall
## 57: Fewer than 10 individuals overall
## 58: Fewer than 10 individuals overall
## 59: Fewer than 10 individuals overall
## 60: Fewer than 10 individuals overall
## 61: Fewer than 10 individuals overall
## condition2
# Create a species list from both conditions:
rare.species <- merge(rare.species1, rare.species2, by = c('unit', 'Species'), all = T) # combine species lists
rare.species <- merge(rare.species, species.list[, .(Species = unique(SciName)), keyby = heb_name], by = 'Species', all.x = T) # Add Hebrew names
setcolorder(rare.species, c('unit','Species', 'heb_name')); setorder(rare.species, unit, Species, heb_name)
rare.species
## unit Species
## 1: Coastal Plain Sands Acanthodactylus aegyptius
## 2: Coastal Plain Sands Chamaeleo chamaeleon
## 3: Coastal Plain Sands Eryx jaculus
## 4: Coastal Plain Sands Laudakia vulgaris
## 5: Coastal Plain Sands Macroprotodon cucullatus
## 6: Coastal Plain Sands Malpolon insignitus
## 7: Coastal Plain Sands Mediodactylus orientalis
## 8: Coastal Plain Sands Platyceps collaris
## 9: Coastal Plain Sands Testudo graeca
## 10: Coastal Plain Sands Varanus griseus
## 11: Coastal Plain Sands Xerotyphlops syriacus
## 12: Inland Sands Chalcides ocellatus
## 13: Inland Sands Macroprotodon cucullatus
## 14: Inland Sands Platyceps rogersi
## 15: Inland Sands Psammophis schokari
## 16: Inland Sands Testudo kleinmanni
## 17: Inland Sands Trapelus savignii
## 18: Loess Covered Areas in the Northern Negev Acanthodactylus beershebensis
## 19: Loess Covered Areas in the Northern Negev Acanthodactylus boskianus
## 20: Loess Covered Areas in the Northern Negev Chalcides sepsoides
## 21: Loess Covered Areas in the Northern Negev Dolichophis jugularis
## 22: Loess Covered Areas in the Northern Negev Eirenis coronelloides
## 23: Loess Covered Areas in the Northern Negev Eirenis rothii
## 24: Loess Covered Areas in the Northern Negev Eryx jaculus
## 25: Loess Covered Areas in the Northern Negev Eumeces schneiderii
## 26: Loess Covered Areas in the Northern Negev Hemidactylus turcicus
## 27: Loess Covered Areas in the Northern Negev Heremites vittatus
## 28: Loess Covered Areas in the Northern Negev Malpolon insignitus
## 29: Loess Covered Areas in the Northern Negev Mesalina bahaeldini
## 30: Loess Covered Areas in the Northern Negev Mesalina olivieri
## 31: Loess Covered Areas in the Northern Negev Platyceps rogersi
## 32: Loess Covered Areas in the Northern Negev Psammophis schokari
## 33: Loess Covered Areas in the Northern Negev Ptyodactylus guttatus
## 34: Loess Covered Areas in the Northern Negev Stenodactylus sthenodactylus
## 35: Loess Covered Areas in the Northern Negev Trapelus agnetae
## 36: Loess Covered Areas in the Northern Negev Varanus griseus
## 37: Mediterranean-Desert Transition Zone Chamaeleo chamaeleon
## 38: Mediterranean-Desert Transition Zone Dolichophis jugularis
## 39: Mediterranean-Desert Transition Zone Eirenis decemlineatus
## 40: Mediterranean-Desert Transition Zone Eirenis rothii
## 41: Mediterranean-Desert Transition Zone Eryx jaculus
## 42: Mediterranean-Desert Transition Zone Hemidactylus turcicus
## 43: Mediterranean-Desert Transition Zone Hemorrhois nummifer
## 44: Mediterranean-Desert Transition Zone Letheobia simoni
## 45: Mediterranean-Desert Transition Zone Malpolon insignitus
## 46: Mediterranean-Desert Transition Zone Micrelaps muelleri
## 47: Mediterranean-Desert Transition Zone Myriopholis macrorhyncha
## 48: Mediterranean-Desert Transition Zone Ophiomorus latastii
## 49: Mediterranean-Desert Transition Zone Platyceps collaris
## 50: Mediterranean-Desert Transition Zone Psammophis schokari
## 51: Mediterranean-Desert Transition Zone Rhynchocalamus melanocephalus
## 52: Mediterranean-Desert Transition Zone Stenodactylus sthenodactylus
## 53: Mediterranean-Desert Transition Zone Telescopus fallax
## 54: Mediterranean-Desert Transition Zone Testudo graeca
## 55: Mediterranean-Desert Transition Zone Xerotyphlops syriacus
## 56: Planted Conifer Forests Chalcides guentheri
## 57: Planted Conifer Forests Chalcides ocellatus
## 58: Planted Conifer Forests Chamaeleo chamaeleon
## 59: Planted Conifer Forests Dolichophis jugularis
## 60: Planted Conifer Forests Eirenis rothii
## 61: Planted Conifer Forests Eumeces schneiderii
## 62: Planted Conifer Forests Hemorrhois nummifer
## 63: Planted Conifer Forests Heremites vittatus
## 64: Planted Conifer Forests Malpolon insignitus
## 65: Planted Conifer Forests Platyceps collaris
## 66: Planted Conifer Forests Psammophis schokari
## 67: Planted Conifer Forests Pseudopus apodus
## 68: Planted Conifer Forests Ptyodactylus guttatus
## 69: Planted Conifer Forests Ptyodactylus puiseuxi
## 70: Planted Conifer Forests Rhynchocalamus melanocephalus
## 71: Planted Conifer Forests Telescopus fallax
## 72: Planted Conifer Forests Testudo graeca
## unit Species
## heb_name condition1
## 1: שנונית מצרית <NA>
## 2: זיקית Fewer than two occurrence per campaign
## 3: חנק Fewer than two occurrence per campaign
## 4: חרדון מצוי <NA>
## 5: נחש כיפה Fewer than two occurrence per campaign
## 6: תלום-קשקשים מצוי <NA>
## 7: שממית עצים <NA>
## 8: זעמן זיתני Fewer than two occurrence per campaign
## 9: צב-יבשה מצוי Fewer than two occurrence per campaign
## 10: כוח אפור Fewer than two occurrence per campaign
## 11: נחשיל מצוי <NA>
## 12: נחושית עינונית Fewer than two occurrence per campaign
## 13: נחש כיפה Fewer than two occurrence per campaign
## 14: זעמן אוכפים Fewer than two occurrence per campaign
## 15: ארבע-קו מובהק <NA>
## 16: צב-יבשה מדברי Fewer than two occurrence per campaign
## 17: חרדון חולות <NA>
## 18: שנונית באר-שבע Fewer than two occurrence per campaign
## 19: שנונית נחלים <NA>
## 20: נחושית חולות Fewer than two occurrence per campaign
## 21: זעמן שחור Fewer than two occurrence per campaign
## 22: שלוון אזורים Fewer than two occurrence per campaign
## 23: שלוון טלוא-ראש Fewer than two occurrence per campaign
## 24: חנק Fewer than two occurrence per campaign
## 25: חומט מנומר Fewer than two occurrence per campaign
## 26: שממית בתים Fewer than two occurrence per campaign
## 27: חומט פסים Fewer than two occurrence per campaign
## 28: תלום-קשקשים מצוי Fewer than two occurrence per campaign
## 29: מדברית עינונית Fewer than two occurrence per campaign
## 30: מדברית פסים Fewer than two occurrence per campaign
## 31: זעמן אוכפים Fewer than two occurrence per campaign
## 32: ארבע-קו מובהק <NA>
## 33: מניפנית מצויה Fewer than two occurrence per campaign
## 34: ישימונית מצויה Fewer than two occurrence per campaign
## 35: חרדון מדבר Fewer than two occurrence per campaign
## 36: כוח אפור <NA>
## 37: זיקית Fewer than two occurrence per campaign
## 38: זעמן שחור Fewer than two occurrence per campaign
## 39: שלוון קוים Fewer than two occurrence per campaign
## 40: שלוון טלוא-ראש Fewer than two occurrence per campaign
## 41: חנק Fewer than two occurrence per campaign
## 42: שממית בתים Fewer than two occurrence per campaign
## 43: זעמן מטבעות Fewer than two occurrence per campaign
## 44: נחשיל חד-ראש Fewer than two occurrence per campaign
## 45: תלום-קשקשים מצוי Fewer than two occurrence per campaign
## 46: מחרוזן דוגוני Fewer than two occurrence per campaign
## 47: נימון דק Fewer than two occurrence per campaign
## 48: חומט נקוד Fewer than two occurrence per campaign
## 49: זעמן זיתני Fewer than two occurrence per campaign
## 50: ארבע-קו מובהק Fewer than two occurrence per campaign
## 51: שחור ראש Fewer than two occurrence per campaign
## 52: ישימונית מצויה Fewer than two occurrence per campaign
## 53: עין-חתול חברבר Fewer than two occurrence per campaign
## 54: צב-יבשה מצוי Fewer than two occurrence per campaign
## 55: נחשיל מצוי Fewer than two occurrence per campaign
## 56: נחושית נחשונית <NA>
## 57: נחושית עינונית Fewer than two occurrence per campaign
## 58: זיקית <NA>
## 59: זעמן שחור Fewer than two occurrence per campaign
## 60: שלוון טלוא-ראש Fewer than two occurrence per campaign
## 61: חומט מנומר Fewer than two occurrence per campaign
## 62: זעמן מטבעות Fewer than two occurrence per campaign
## 63: חומט פסים Fewer than two occurrence per campaign
## 64: תלום-קשקשים מצוי Fewer than two occurrence per campaign
## 65: זעמן זיתני Fewer than two occurrence per campaign
## 66: ארבע-קו מובהק <NA>
## 67: קמטן החורש Fewer than two occurrence per campaign
## 68: מניפנית מצויה Fewer than two occurrence per campaign
## 69: מניפנית גלילית Fewer than two occurrence per campaign
## 70: שחור ראש Fewer than two occurrence per campaign
## 71: עין-חתול חברבר Fewer than two occurrence per campaign
## 72: צב-יבשה מצוי Fewer than two occurrence per campaign
## heb_name condition1
## condition2
## 1: Fewer than 10 individuals overall
## 2: Fewer than 10 individuals overall
## 3: <NA>
## 4: Fewer than 10 individuals overall
## 5: <NA>
## 6: Fewer than 10 individuals overall
## 7: Fewer than 10 individuals overall
## 8: Fewer than 10 individuals overall
## 9: <NA>
## 10: Fewer than 10 individuals overall
## 11: Fewer than 10 individuals overall
## 12: Fewer than 10 individuals overall
## 13: Fewer than 10 individuals overall
## 14: Fewer than 10 individuals overall
## 15: Fewer than 10 individuals overall
## 16: Fewer than 10 individuals overall
## 17: Fewer than 10 individuals overall
## 18: <NA>
## 19: Fewer than 10 individuals overall
## 20: Fewer than 10 individuals overall
## 21: Fewer than 10 individuals overall
## 22: Fewer than 10 individuals overall
## 23: Fewer than 10 individuals overall
## 24: Fewer than 10 individuals overall
## 25: Fewer than 10 individuals overall
## 26: <NA>
## 27: <NA>
## 28: Fewer than 10 individuals overall
## 29: <NA>
## 30: Fewer than 10 individuals overall
## 31: Fewer than 10 individuals overall
## 32: Fewer than 10 individuals overall
## 33: Fewer than 10 individuals overall
## 34: Fewer than 10 individuals overall
## 35: Fewer than 10 individuals overall
## 36: Fewer than 10 individuals overall
## 37: Fewer than 10 individuals overall
## 38: Fewer than 10 individuals overall
## 39: Fewer than 10 individuals overall
## 40: Fewer than 10 individuals overall
## 41: Fewer than 10 individuals overall
## 42: <NA>
## 43: Fewer than 10 individuals overall
## 44: Fewer than 10 individuals overall
## 45: Fewer than 10 individuals overall
## 46: Fewer than 10 individuals overall
## 47: Fewer than 10 individuals overall
## 48: Fewer than 10 individuals overall
## 49: Fewer than 10 individuals overall
## 50: Fewer than 10 individuals overall
## 51: Fewer than 10 individuals overall
## 52: Fewer than 10 individuals overall
## 53: Fewer than 10 individuals overall
## 54: <NA>
## 55: Fewer than 10 individuals overall
## 56: Fewer than 10 individuals overall
## 57: <NA>
## 58: Fewer than 10 individuals overall
## 59: Fewer than 10 individuals overall
## 60: Fewer than 10 individuals overall
## 61: Fewer than 10 individuals overall
## 62: Fewer than 10 individuals overall
## 63: <NA>
## 64: Fewer than 10 individuals overall
## 65: Fewer than 10 individuals overall
## 66: Fewer than 10 individuals overall
## 67: Fewer than 10 individuals overall
## 68: Fewer than 10 individuals overall
## 69: Fewer than 10 individuals overall
## 70: Fewer than 10 individuals overall
## 71: Fewer than 10 individuals overall
## 72: Fewer than 10 individuals overall
## condition2
rare.species[, .(no.of.rare.spp = uniqueN(Species)), keyby = unit] # no fewer than 19 rare species in the semi desert
## unit no.of.rare.spp
## 1: Coastal Plain Sands 11
## 2: Inland Sands 6
## 3: Loess Covered Areas in the Northern Negev 19
## 4: Mediterranean-Desert Transition Zone 19
## 5: Planted Conifer Forests 17
write_excel_csv(rare.species, file = 'Output/Rare species to be removed from certrain analyses.csv')
rm(rare.species1, rare.species2) # clean up
# Indicate rare species per unit
reptiles <- merge(reptiles, rare.species[, .(SciName = Species, unit, is.rare.in.unit = T)], by = c('unit', 'SciName'), all.x = T)
reptiles[is.na(is.rare.in.unit), is.rare.in.unit := F]
reptiles[survey_ID %in% reptiles[is.rare.in.unit == F, unique(survey_ID)], unique(survey_ID)]
## [1] T0_Netiv Haasara Far Semi-Shifting 2
## [2] T0_Netiv Haasara Far Shifting 2
## [3] T0_Netiv Haasara Far Shifting 3
## [4] T0_Netiv Haasara Near Semi-Shifting 1
## [5] T1_Caesarea Far Semi-Shifting 3
## [6] T1_Caesarea Far Shifting 2
## [7] T1_Caesarea Near Semi-Shifting 1
## [8] T1_Caesarea Near Semi-Shifting 2
## [9] T1_Caesarea Near Semi-Shifting 3
## [10] T2_Ashkelon Far Shifting 3
## [11] T2_Ashkelon Near Semi-Shifting 2
## [12] T2_Caesarea Far Semi-Shifting 1
## [13] T2_Caesarea Far Semi-Shifting 2
## [14] T2_Caesarea Far Semi-Shifting 3
## [15] T2_Caesarea Far Shifting 1
## [16] T2_Caesarea Far Shifting 2
## [17] T2_Caesarea Far Shifting 3
## [18] T2_Caesarea Near Semi-Shifting 1
## [19] T2_Caesarea Near Semi-Shifting 3
## [20] T2_Zikim Near Semi-Shifting 3
## [21] T3_Ashkelon Near Semi-Shifting 1
## [22] T3_Caesarea Far Semi-Shifting 1
## [23] T3_Caesarea Far Semi-Shifting 2
## [24] T3_Caesarea Far Semi-Shifting 3
## [25] T3_Caesarea Far Shifting 1
## [26] T3_Caesarea Far Shifting 2
## [27] T3_Caesarea Far Shifting 3
## [28] T3_Caesarea Near Semi-Shifting 1
## [29] T3_Caesarea Near Semi-Shifting 2
## [30] T4_Ashdod Near Semi-Shifting 3
## [31] T4_Ashkelon Far Shifting 3
## [32] T4_Caesarea Far Semi-Shifting 1
## [33] T4_Caesarea Far Semi-Shifting 2
## [34] T4_Caesarea Far Semi-Shifting 3
## [35] T4_Caesarea Far Shifting 1
## [36] T4_Caesarea Far Shifting 2
## [37] T4_Caesarea Far Shifting 3
## [38] T4_Caesarea Near Semi-Shifting 1
## [39] T4_Caesarea Near Semi-Shifting 2
## [40] T4_Caesarea Near Semi-Shifting 3
## [41] T4_Zikim Near Semi-Shifting 2
## [42] T4_Zikim Near Semi-Shifting 3
## [43] T0_Ashdod Far Semi-Shifting 1
## [44] T0_Ashdod Far Semi-Shifting 2
## [45] T0_Ashdod Far Semi-Shifting 3
## [46] T0_Ashdod Far Shifting 1
## [47] T0_Ashdod Far Shifting 2
## [48] T0_Ashdod Far Shifting 3
## [49] T0_Ashdod Near Semi-Shifting 1
## [50] T0_Ashdod Near Semi-Shifting 2
## [51] T0_Ashdod Near Semi-Shifting 3
## [52] T0_Ashkelon Far Semi-Shifting 1
## [53] T0_Ashkelon Far Semi-Shifting 3
## [54] T0_Ashkelon Far Shifting 1
## [55] T0_Ashkelon Far Shifting 3
## [56] T0_Ashkelon Near Semi-Shifting 2
## [57] T0_Netiv Haasara Far Semi-Shifting 1
## [58] T0_Netiv Haasara Far Shifting 1
## [59] T1_Ashdod Far Semi-Shifting 1
## [60] T1_Ashdod Far Semi-Shifting 2
## [61] T1_Ashdod Far Semi-Shifting 3
## [62] T1_Ashdod Far Shifting 1
## [63] T1_Ashdod Far Shifting 2
## [64] T1_Ashdod Far Shifting 3
## [65] T1_Ashdod Near Semi-Shifting 3
## [66] T1_Ashkelon Far Semi-Shifting 1
## [67] T1_Ashkelon Far Semi-Shifting 3
## [68] T1_Ashkelon Far Shifting 1
## [69] T1_Zikim Far Semi-Shifting 1
## [70] T1_Zikim Near Semi-Shifting 1
## [71] T1_Zikim Near Semi-Shifting 3
## [72] T2_Ashdod Far Semi-Shifting 1
## [73] T2_Ashdod Far Semi-Shifting 2
## [74] T2_Ashdod Far Semi-Shifting 3
## [75] T2_Ashdod Far Shifting 1
## [76] T2_Ashdod Far Shifting 2
## [77] T2_Ashdod Far Shifting 3
## [78] T2_Ashdod Near Semi-Shifting 1
## [79] T2_Ashdod Near Semi-Shifting 3
## [80] T2_Ashkelon Far Semi-Shifting 1
## [81] T2_Ashkelon Far Semi-Shifting 3
## [82] T2_Ashkelon Far Shifting 1
## [83] T2_Ashkelon Far Shifting 2
## [84] T2_Ashkelon Near Semi-Shifting 3
## [85] T2_Zikim Far Semi-Shifting 1
## [86] T2_Zikim Far Semi-Shifting 2
## [87] T2_Zikim Far Semi-Shifting 3
## [88] T2_Zikim Far Shifting 1
## [89] T2_Zikim Far Shifting 2
## [90] T2_Zikim Far Shifting 3
## [91] T2_Zikim Near Semi-Shifting 1
## [92] T3_Ashdod Far Semi-Shifting 1
## [93] T3_Ashdod Far Semi-Shifting 2
## [94] T3_Ashdod Far Semi-Shifting 3
## [95] T3_Ashdod Far Shifting 1
## [96] T3_Ashdod Far Shifting 2
## [97] T3_Ashdod Far Shifting 3
## [98] T3_Ashdod Near Semi-Shifting 1
## [99] T3_Ashdod Near Semi-Shifting 3
## [100] T3_Ashkelon Far Semi-Shifting 1
## [101] T3_Ashkelon Far Semi-Shifting 2
## [102] T3_Ashkelon Far Semi-Shifting 3
## [103] T3_Ashkelon Far Shifting 1
## [104] T3_Ashkelon Far Shifting 2
## [105] T3_Ashkelon Far Shifting 3
## [106] T3_Zikim Far Semi-Shifting 1
## [107] T3_Zikim Far Semi-Shifting 2
## [108] T3_Zikim Far Semi-Shifting 3
## [109] T3_Zikim Far Shifting 1
## [110] T3_Zikim Far Shifting 2
## [111] T3_Zikim Far Shifting 3
## [112] T3_Zikim Near Semi-Shifting 1
## [113] T3_Zikim Near Semi-Shifting 2
## [114] T3_Zikim Near Semi-Shifting 3
## [115] T4_Ashdod Far Semi-Shifting 1
## [116] T4_Ashdod Far Semi-Shifting 2
## [117] T4_Ashdod Far Semi-Shifting 3
## [118] T4_Ashdod Far Shifting 1
## [119] T4_Ashdod Far Shifting 2
## [120] T4_Ashdod Far Shifting 3
## [121] T4_Ashkelon Far Semi-Shifting 1
## [122] T4_Ashkelon Far Semi-Shifting 2
## [123] T4_Ashkelon Far Semi-Shifting 3
## [124] T4_Ashkelon Far Shifting 1
## [125] T4_Ashkelon Far Shifting 2
## [126] T4_Ashkelon Near Semi-Shifting 1
## [127] T4_Zikim Far Semi-Shifting 2
## [128] T4_Zikim Far Semi-Shifting 3
## [129] T4_Zikim Far Shifting 1
## [130] T4_Zikim Far Shifting 2
## [131] T4_Zikim Far Shifting 3
## [132] T0_Ashkelon Near Semi-Shifting 1
## [133] T0_Ashkelon Near Semi-Shifting 3
## [134] T0_Netiv Haasara Near Semi-Shifting 3
## [135] T1_Ashdod Near Semi-Shifting 2
## [136] T1_Ashkelon Near Semi-Shifting 2
## [137] T1_Caesarea Far Semi-Shifting 1
## [138] T1_Caesarea Far Semi-Shifting 2
## [139] T2_Ashkelon Far Semi-Shifting 2
## [140] T2_Ashkelon Near Semi-Shifting 1
## [141] T2_Caesarea Near Semi-Shifting 2
## [142] T2_Zikim Near Semi-Shifting 2
## [143] T3_Ashkelon Near Semi-Shifting 2
## [144] T4_Ashdod Near Semi-Shifting 1
## [145] T4_Ashkelon Near Semi-Shifting 3
## [146] T0_Ashkelon Far Semi-Shifting 2
## [147] T0_Ashkelon Far Shifting 2
## [148] T0_Netiv Haasara Far Semi-Shifting 3
## [149] T0_Netiv Haasara Near Semi-Shifting 2
## [150] T1_Ashdod Near Semi-Shifting 1
## [151] T1_Ashkelon Far Semi-Shifting 2
## [152] T1_Ashkelon Far Shifting 2
## [153] T1_Ashkelon Far Shifting 3
## [154] T1_Ashkelon Near Semi-Shifting 1
## [155] T1_Ashkelon Near Semi-Shifting 3
## [156] T1_Caesarea Far Shifting 1
## [157] T1_Caesarea Far Shifting 3
## [158] T1_Zikim Far Semi-Shifting 2
## [159] T1_Zikim Far Semi-Shifting 3
## [160] T1_Zikim Far Shifting 1
## [161] T1_Zikim Near Semi-Shifting 2
## [162] T2_Ashdod Near Semi-Shifting 2
## [163] T3_Ashdod Near Semi-Shifting 2
## [164] T3_Ashkelon Near Semi-Shifting 3
## [165] T4_Ashdod Near Semi-Shifting 2
## [166] T4_Ashkelon Near Semi-Shifting 2
## [167] T4_Zikim Far Semi-Shifting 1
## [168] T4_Zikim Near Semi-Shifting 1
## [169] T1_Zikim Far Shifting 3
## [170] T1_Zikim Far Shifting 2
## [171] T2_Beer Milka Far Shifting 1
## [172] T2_Beer Milka Far Shifting 2
## [173] T2_Beer Milka Far Shifting 3
## [174] T2_Secher Far Shifting 1
## [175] T2_Secher Far Shifting 3
## [176] T2_Shunra East Far Shifting 1
## [177] T2_Shunra East Far Shifting 2
## [178] T2_Shunra East Far Shifting 3
## [179] T3_Beer Milka Far Semi-Shifting 4
## [180] T3_Beer Milka Far Shifting 1
## [181] T3_Beer Milka Far Shifting 2
## [182] T3_Beer Milka Near Shifting 1
## [183] T3_Beer Milka Near Shifting 2
## [184] T3_Secher Far Shifting 2
## [185] T3_Shunra East Far Semi-Shifting 1
## [186] T3_Shunra East Far Shifting 1
## [187] T3_Shunra East Far Shifting 2
## [188] T3_Shunra East Far Shifting 3
## [189] T4_Beer Milka Far Semi-Shifting 2
## [190] T4_Beer Milka Far Semi-Shifting 3
## [191] T4_Beer Milka Far Semi-Shifting 4
## [192] T4_Beer Milka Far Shifting 1
## [193] T4_Beer Milka Far Shifting 2
## [194] T4_Beer Milka Far Shifting 3a
## [195] T4_Beer Milka Near Semi-Shifting 1
## [196] T4_Beer Milka Near Shifting 1
## [197] T4_Beer Milka Near Shifting 2
## [198] T4_Secher Far Shifting 3
## [199] T4_Shunra East Far Shifting 1
## [200] T4_Shunra East Far Shifting 2
## [201] T2_Beer Milka Far Semi-Shifting 2
## [202] T2_Beer Milka Far Semi-Shifting 4
## [203] T2_Beer Milka Near Semi-Shifting 1
## [204] T2_Beer Milka Near Semi-Shifting 2
## [205] T2_Beer Milka Near Semi-Shifting 3
## [206] T2_Beer Milka Near Shifting 2
## [207] T2_Beer Milka Near Shifting 3
## [208] T2_Secher Far Semi-Shifting 1
## [209] T2_Secher Far Semi-Shifting 3
## [210] T2_Secher Far Semi-Shifting 4
## [211] T2_Shunra East Far Semi-Shifting 1
## [212] T2_Shunra East Far Semi-Shifting 2
## [213] T2_Shunra East Far Semi-Shifting 3
## [214] T3_Beer Milka Far Semi-Shifting 2
## [215] T3_Beer Milka Far Semi-Shifting 3
## [216] T3_Beer Milka Far Shifting 3
## [217] T3_Beer Milka Near Semi-Shifting 1
## [218] T3_Beer Milka Near Semi-Shifting 2
## [219] T3_Beer Milka Near Semi-Shifting 3
## [220] T3_Beer Milka Near Shifting 3
## [221] T3_Secher Far Semi-Shifting 1
## [222] T3_Secher Far Semi-Shifting 3
## [223] T3_Secher Far Semi-Shifting 4
## [224] T3_Secher Far Shifting 1
## [225] T3_Shunra East Far Semi-Shifting 2
## [226] T3_Shunra East Far Semi-Shifting 3
## [227] T4_Beer Milka Near Semi-Shifting 2
## [228] T4_Beer Milka Near Semi-Shifting 3
## [229] T4_Beer Milka Near Shifting 3
## [230] T4_Secher Far Semi-Shifting 1
## [231] T4_Secher Far Semi-Shifting 3
## [232] T4_Secher Far Semi-Shifting 4
## [233] T4_Secher Far Shifting 1
## [234] T4_Secher Far Shifting 2
## [235] T4_Shunra East Far Semi-Shifting 1
## [236] T4_Shunra East Far Semi-Shifting 2
## [237] T4_Shunra East Far Semi-Shifting 3
## [238] T4_Shunra East Far Shifting 3
## [239] T2_Secher Far Shifting 2
## [240] T2_Beer Milka Near Shifting 1
## [241] T3_Secher Far Shifting 3
## [242] T2_Beer Milka Far Semi-Shifting 3
## [243] T0_Eshsel Hanasai Agri 2
## [244] T0_Mishmar Hanegev Kkl 2
## [245] T0_Sayeret Shaked Kkl 3
## [246] T0_Sayeret Shaked Kkl 4
## [247] T0_Sayeret Shaked Loess 31.27486693_34.68890758
## [248] T1_Goral Bedouin Agriculture 1
## [249] T1_Goral Bedouin Agriculture 3
## [250] T2_Eshsel Hanasai Agri 3
## [251] T2_Nahal Ashan Loess 2
## [252] T2_Park Loess Loess 2
## [253] T3_Eshsel Hanasai Agri 3
## [254] T3_Goral Bedouin Agriculture 1
## [255] T3_Mishmar Hanegev Kkl 1
## [256] T3_Sayeret Shaked Kkl Plantings 3
## [257] T3_Sayeret Shaked Loess 2
## [258] T0_Park Loess Loess 31.24477105_34.60143498
## [259] T2_Park Loess Loess 1
## [260] T0_Nahal Ashan Kkl Plantings 1
## [261] T0_Nahal Ashan Kkl Plantings 2
## [262] T0_Nahal Ashan Loess 31.28245503_34.75764806
## [263] T0_Nahal Ashan Loess 31.29271253_34.76700752
## [264] T0_Nahal Ashan Loess 31.29436508_34.77658303
## [265] T0_Sayeret Shaked Kkl Plantings 31.27594968_34.66259602
## [266] T0_Sayeret Shaked Loess 31.27294696_34.69498356
## [267] T1_Goral Bedouin Agriculture 2
## [268] T1_Mishmar Hanegev Bedouin Agriculture 3
## [269] T1_Nahal Ashan Kkl Plantings 1
## [270] T1_Nahal Ashan Kkl Plantings 31.28265093_34.74863154
## [271] T1_Nahal Ashan Loess 2
## [272] T1_Nahal Ashan Loess 3
## [273] T1_Sayeret Shaked Kkl Plantings 1
## [274] T2_Eshel Hanasi Bedouin Agriculture 1
## [275] T2_Givot Bar Bedouin Agriculture 3
## [276] T2_Goral Bedouin Agriculture 3
## [277] T2_Mishmar Hanegev Bedouin Agriculture 1
## [278] T2_Mishmar Hanegev Bedouin Agriculture 2
## [279] T2_Mishmar Hanegev Kkl Plantings 2
## [280] T2_Nahal Ashan Kkl Plantings 1
## [281] T2_Nahal Ashan Kkl Plantings 2
## [282] T2_Nahal Ashan Loess 1
## [283] T2_Nahal Ashan Loess 3
## [284] T2_Sayeret Shaked Kkl Plantings 1
## [285] T2_Sayeret Shaked Kkl Plantings 31.26959058_34.66913156
## [286] T2_Sayeret Shaked Loess 1
## [287] T3_Mishmar Hanegev Bedouin Agriculture 1
## [288] T3_Mishmar Hanegev Kkl Plantings 2
## [289] T3_Nahal Ashan Kkl Plantings 2
## [290] T3_Nahal Ashan Loess 1
## [291] T3_Nahal Ashan Loess 2
## [292] T3_Nahal Ashan Loess 3
## [293] T3_Sayeret Shaked Kkl Plantings 1
## [294] T3_Sayeret Shaked Kkl Plantings 31.26959058_34.66913156
## [295] T3_Sayeret Shaked Loess 31.27486693_34.68890758
## [296] T0_Mishmar Hanegev Kkl Plantings 31.36493851_34.72983363
## [297] T1_Mishmar Hanegev Kkl Plantings 1
## [298] T1_Mishmar Hanegev Kkl Plantings 3
## [299] T1_Nahal Ashan Kkl Plantings 3
## [300] T2_Nahal Ashan Kkl Plantings 3
## [301] T3_Mishmar Hanegev Kkl Plantings 3
## [302] T3_Nahal Ashan Kkl Plantings 1
## [303] T1_Givot Bar Bedouin Agriculture 2
## [304] T2_Givot Bar Bedouin Agriculture 2
## [305] T1_Eshel Hanasi Bedouin Agriculture 31.34189242_34.70906885
## [306] T1_Mishmar Hanegev Bedouin Agriculture 1
## [307] T1_Mishmar Hanegev Kkl Plantings 2
## [308] T1_Mishmar Hanegev Bedouin Agriculture 2
## [309] T0_Eshel Hanasi Bedouin Agriculture 31.33814194_34.71648947
## [310] T0_Givot Bar Bedouin Agriculture 31.36423692_34.75671353
## [311] T0_Mishmar Hanegev Bedouin Agriculture 31.35953705_34.74353936
## [312] T0_Mishmar Hanegev Kkl Plantings 31.36351136_34.73422216
## [313] T3_Nahal Ashan Kkl Plantings 3
## [314] T0_Eshel Hanasi Bedouin Agriculture 31.34189216_34.7090606
## [315] T0_Givot Bar Bedouin Agriculture 31.36034694_34.75049867
## [316] T0_Givot Bar Bedouin Agriculture 31.37352221_34.77122583
## [317] T0_Mishmar Hanegev Bedouin Agriculture 31.36963753_34.74636994
## [318] T0_Mishmar Hanegev Bedouin Agriculture 31.37129176_34.73660277
## [319] T1_Eshel Hanasi Bedouin Agriculture 1
## [320] T1_Givot Bar Bedouin Agriculture 1
## [321] T1_Givot Bar Bedouin Agriculture 3
## [322] T1_Nahal Ashan Loess 1
## [323] T3_Eshel Hanasi Bedouin Agriculture 1
## [324] T3_Givot Bar Bedouin Agriculture 1
## [325] T3_Mishmar Hanegev Bedouin Agriculture 2
## [326] T0_Lahav Far 3
## [327] T0_Lehavim Far 1
## [328] T0_Lehavim Near 12
## [329] T1_Lehavim Near 11
## [330] T1_Beit Yatir Near 31.36253667_35.11037048
## [331] T1_Lahav Near 1
## [332] T1_Lahav Near 3
## [333] T2_Har Amasa Near 1
## [334] T2_Lahav Near 3
## [335] T3_Beit Yatir Near 31.36983661_35.11023647
## [336] T3_Har Amasa Far 2
## [337] T3_Har Amasa Near 3
## [338] T3_Lahav Near 1
## [339] T3_Mirsham Far 12
## [340] T0_Lahav Near 31.38063841_34.86321922
## [341] T0_Lahav Near 31.38116555_34.87381881
## [342] T0_Lahav Near 31.38184847_34.86639343
## [343] T0_Lehavim Far 31.3350892_34.83998961
## [344] T0_Mirsham Far 31.50077347_34.93924637
## [345] T0_Mirsham Near 31.47977937_34.92723182
## [346] T1_Lahav Far 1
## [347] T1_Mirsham Far 2
## [348] T1_Mirsham Near 31.47977814_34.92723773
## [349] T2_Lahav Near 1
## [350] T2_Mirsham Near 1
## [351] T2_Mirsham Near 31.47977814_34.92723773
## [352] T3_Beit Yatir Near 1
## [353] T3_Beit Yatir Near 31.36253667_35.11037048
## [354] T3_Lahav Near 31.38063825_34.86322581
## [355] T3_Mirsham Near 1
## [356] T3_Mirsham Near 31.47977814_34.92723773
## [357] T0_Har Amasa Far 31.33245149_35.10733619
## [358] T0_Lahav Far 31.38801501_34.860428
## [359] T0_Mirsham Far 31.45827683_34.90100711
## [360] T0_Mirsham Far 31.5002719_34.92750673
## [361] T0_Mirsham Near 31.47629966_34.92475669
## [362] T1_Beit Yatir Far 1
## [363] T1_Beit Yatir Far 31.36048207_35.13024331
## [364] T1_Har Amasa Near 2
## [365] T1_Lehavim Far 2
## [366] T1_Mirsham Far 12
## [367] T1_Mirsham Near 1
## [368] T2_Beit Yatir Far 2
## [369] T2_Beit Yatir Far 3
## [370] T2_Beit Yatir Near 1
## [371] T2_Har Amasa Near 2
## [372] T2_Lahav Near 31.38063825_34.86322581
## [373] T2_Lehavim Far 1
## [374] T2_Lehavim Near 11
## [375] T2_Mirsham Far 11
## [376] T2_Mirsham Far 12
## [377] T3_Beit Yatir Far 3
## [378] T3_Lehavim Far 1
## [379] T3_Mirsham Far 11
## [380] T3_Mirsham Far 2
## [381] T1_Beit Yatir Far 3
## [382] T3_Beit Yatir Far 1
## [383] T3_Har Amasa Near 1
## [384] T0_Beit Yatir Near 31.3616697_35.10994797
## [385] T0_Beit Yatir Near 31.35936566_35.11638381
## [386] T0_Lahav Far 31.39560409_34.85918386
## [387] T0_Lehavim Far 31.35798817_34.84029091
## [388] T1_Har Amasa Near 1
## [389] T1_Lehavim Near 12
## [390] T2_Har Amasa Far 1
## [391] T2_Har Amasa Far 2
## [392] T2_Lehavim Far 31.35798826_34.84029775
## [393] T3_Lehavim Far 2
## [394] T0_Beit Yatir Far 31.36048202_35.13023961
## [395] T3_Har Amasa Far 31.33245184_35.10734014
## [396] T3_Lehavim Near 31.36815469_34.82320446
## [397] T3_Mirsham Near 81
## [398] T0_Mirsham Near 31.48034042_34.92626049
## [399] T1_Beit Yatir Near 1
## [400] T1_Beit Yatir Near 31.36983661_35.11023647
## [401] T1_Har Amasa Far 1
## [402] T1_Har Amasa Far 2
## [403] T1_Lahav Far 2
## [404] T1_Lahav Near 31.38063825_34.86322581
## [405] T1_Lehavim Far 31.35798826_34.84029775
## [406] T2_Beit Yatir Far 1
## [407] T2_Beit Yatir Near 31.36253667_35.11037048
## [408] T2_Har Amasa Near 3
## [409] T2_Lahav Far 3
## [410] T2_Lehavim Far 2
## [411] T2_Lehavim Near 31.36815469_34.82320446
## [412] T2_Mirsham Far 2
## [413] T3_Beit Yatir Far 2
## [414] T3_Har Amasa Near 2
## [415] T3_Lahav Far 3
## [416] T3_Lahav Near 3
## [417] T3_Lehavim Far 31.35798826_34.84029775
## [418] T3_Lehavim Near 11
## [419] T0_Lehavim Near 6
## [420] T0_Beit Yatir Near 31.36983666_35.11023255
## [421] T0_Har Amasa Far 31.35044064_35.12192146
## [422] T0_Har Amasa Near 31.3435548_35.10418644
## [423] T1_Har Amasa Far 31.33245184_35.10734014
## [424] T1_Lehavim Near 31.36815469_34.82320446
## [425] T2_Beit Yatir Near 31.36983661_35.11023647
## [426] T2_Har Amasa Far 31.33245184_35.10734014
## [427] T2_Lehavim Near 12
## [428] T0_Beit Yatir Far 31.35114151_35.12245726
## [429] T0_Beit Yatir Far 31.35013846_35.11235947
## [430] T0_Har Amasa Near 31.34493183_35.10377892
## [431] T0_Lehavim Near 11
## [432] T1_Lehavim Far 1
## [433] T3_Lehavim Near 12
## [434] T0_Har Amasa Far 31.34690363_35.11116131
## [435] T1_Mirsham Far 31.47465474_34.9201405
## [436] T2_Mirsham Near 81
## [437] T3_Lahav Far 2
## [438] T0_Aderet 31.67867469_34.98154177
## [439] T0_Bat Shlomo Far 1
## [440] T0_Bat Shlomo Far 2
## [441] T0_Eitanim Far 1
## [442] T0_Eitanim Far 3
## [443] T0_Eshtaol Far 1
## [444] T0_Givat Yeshayahu Far 1
## [445] T0_Kerem Maharal Kkl Plantings 2
## [446] T0_Manara Kkl Plantings 3
## [447] T0_Meron 32.99189342_35.45548018
## [448] T0_Meron Kkl Plantings 1
## [449] T0_Meron Kkl Plantings 2
## [450] T0_Ofer Kkl Plantings 2
## [451] T0_Ramat Hashofet - Kkl Plantings 1
## [452] T0_Ramat Hashofet - Kkl Plantings 2
## [453] T0_Ramat Hashofet - Kkl Plantings 3
## [454] T0_Zuriel Kkl Plantings 1
## [455] T1_Bat Shlomo Far 1
## [456] T1_Eitanim Far 2
## [457] T1_Eshtaol Far 3
## [458] T1_Eshtaol Far 4
## [459] T1_Manara Far 2
## [460] T1_Manara Far 3
## [461] T1_Meron Far 1
## [462] T1_Meron Far 2
## [463] T1_Ramot Naftali Kkl Plantings 1
## [464] T1_Zuriel Far 1
## [465] T2_Eitanim 31.77492651_35.09886264
## [466] T2_Eitanim Kkl Plantings 2
## [467] T2_Manara - Kkl Plantings 1
## [468] T2_Ramat Hashofet - Kkl Plantings 1
## [469] T2_Ramat Hashofet - Kkl Plantings 2
## [470] T2_Zuriel - Kkl Plantings 2
## [471] T2_Zuriel - Kkl Plantings 3
## [472] T3_Eitanim 31.77814645_35.10938566
## [473] T3_Kerem Maharal Kkl Plantings 2
## [474] T3_Meron Kkl Plantings 1
## [475] T3_Meron Kkl Plantings 2
## [476] T3_Ramot Naftali Kkl Plantings 3
## [477] T3_Zuriel Kkl Plantings 1
## [478] T4_Eitanim 31.77814645_35.10938566
## [479] T4_Eitanim Kkl Plantings 3a
## [480] T4_Kabri 33.02024909_35.15766172
## [481] T4_Kabri 33.02051057_35.16410644
## [482] T4_Kabri 33.02076963_35.17121742
## [483] T4_Manara Kkl Plantings 2
## [484] T4_Zuriel 33.01398017_35.31735242
## [485] T4_Zuriel Kkl Plantings 1a
## [486] T0_Eitanim Kkl 2
## [487] T0_Elyakim 32.663718_35.0561739
## [488] T0_Elyakim 32.66706551_35.05568276
## [489] T0_Elyakim 32.66729268_35.06300807
## [490] T0_Eshtaol Kkl 3
## [491] T0_Kerem Maharal Kkl Plantings 1
## [492] T0_Manara Kkl 2
## [493] T0_Ofer 32.66116094_34.96865537
## [494] T0_Ofer Kkl 3
## [495] T0_Ramot Naftali 33.09405282_35.56702946
## [496] T0_Ramot Naftali 33.09853595_35.56487564
## [497] T0_Zuriel Kkl 2
## [498] T0_Zuriel Kkl 3
## [499] T1_Amatzia 31.50751869_34.8949584
## [500] T1_Amatzia 31.51244719_34.89349107
## [501] T1_Amatzia 31.51439867_34.8982574
## [502] T1_Bat Shlomo 32.58716874_35.01054242
## [503] T1_Elyakim 32.66370396_35.05617847
## [504] T1_Elyakim 32.66705144_35.05568733
## [505] T1_Elyakim 32.6672786_35.06301256
## [506] T1_Givat Yeshaayahu Kkl Plantings 2
## [507] T1_Kabri 33.02024909_35.15766172
## [508] T1_Kabri 33.02051057_35.16410644
## [509] T1_Kerem Maharal 32.61227564_34.96368766
## [510] T1_Kerem Maharal 32.61601959_34.96652201
## [511] T1_Kerem Maharal Kkl Plantings 1
## [512] T1_Ofer 32.65474897_34.97793598
## [513] T1_Ofer Kkl Plantings 3
## [514] T1_Ramat Hashofet 32.61710013_35.11234171
## [515] T1_Ramat Hashofet 32.62225135_35.11265519
## [516] T1_Ramat Hashofet 33.0939666_35.5664466
## [517] T1_Ramat Hashofet 33.098205_35.564775
## [518] T1_Zuriel 33.01091098_35.31488335
## [519] T1_Zuriel 33.01398017_35.31735242
## [520] T2_Amatzia 31.50751869_34.8949584
## [521] T2_Amatzia 31.51439867_34.8982574
## [522] T2_Bat Shlomo 32.58547442_35.01415585
## [523] T2_Bat Shlomo 32.58716874_35.01054242
## [524] T2_Elyakim 32.66705144_35.05568733
## [525] T2_Elyakim 32.6672786_35.06301256
## [526] T2_Eshtaol Kkl Plantings 3
## [527] T2_Eshtaol Kkl Plantings 4
## [528] T2_Givat Yeshaayahu Kkl Plantings 1
## [529] T2_Kabri 33.02024909_35.15766172
## [530] T2_Kabri 33.02051057_35.16410644
## [531] T2_Kerem Maharal Kkl Plantings 1
## [532] T2_Manara Kkl Plantings 3
## [533] T2_Ofer Kkl Plantings 1
## [534] T2_Ramot Naftali Kkl Plantings 1
## [535] T2_Ramot Naftali Kkl Plantings 2
## [536] T2_Ramot Naftali Kkl Plantings 3
## [537] T3_Aderet 31.67144877_34.9880248
## [538] T3_Aderet 31.67577723_34.98668826
## [539] T3_Amatzia 31.51244719_34.89349107
## [540] T3_Amatzia 31.51439867_34.8982574
## [541] T3_Bat Shlomo 32.58547442_35.01415585
## [542] T3_Bat Shlomo 32.58716874_35.01054242
## [543] T3_Eitanim Kkl Plantings 2
## [544] T3_Elyakim 32.66370396_35.05617847
## [545] T3_Elyakim 32.66705144_35.05568733
## [546] T3_Elyakim 32.6672786_35.06301256
## [547] T3_Eshtaol Kkl Plantings 4
## [548] T3_Givat Yeshaayahu Kkl Plantings 3
## [549] T3_Kabri 33.02051057_35.16410644
## [550] T3_Kabri 33.02076963_35.17121742
## [551] T3_Meron 32.99189342_35.45548018
## [552] T3_Ofer Kkl Plantings 3
## [553] T3_Ramat Hashofet 32.61710013_35.11234171
## [554] T3_Ramat Hashofet 32.62225135_35.11265519
## [555] T3_Ramat Hashofet Kkl Plantings 4
## [556] T3_Zuriel 33.01091098_35.31488335
## [557] T3_Zuriel 33.01398017_35.31735242
## [558] T4_Bat Shlomo 32.58547442_35.01415585
## [559] T4_Bat Shlomo 32.58716874_35.01054242
## [560] T4_Bat Shlomo Kkl Plantings 1
## [561] T4_Elyakim 32.66370396_35.05617847
## [562] T4_Elyakim 32.6672786_35.06301256
## [563] T4_Eshtaol 31.79075347_35.01995897
## [564] T4_Eshtaol Kkl Plantings 3
## [565] T4_Givat Yeshaayahu Kkl Plantings 3
## [566] T4_Manara Kkl Plantings 3
## [567] T4_Meron 32.99189342_35.45548018
## [568] T4_Ramat Hashofet 32.62225135_35.11265519
## [569] T4_Zuriel 33.01091098_35.31488335
## [570] T3_Amatzia 31.50751869_34.8949584
## [571] T3_Eshtaol Kkl Plantings 3
## [572] T4_Eshtaol Kkl Plantings 4
## [573] T3_Aderet 31.67867469_34.98154177
## [574] T4_Ofer Kkl Plantings 1
## [575] T1_Aderet 31.67577723_34.98668826
## [576] T4_Meron Kkl Plantings 1
## [577] T4_Manara 33.18276851_35.54829503
## [578] T0_Aderet Kkl 2
## [579] T0_Aderet Kkl 3
## [580] T0_Amatzia 31.50752022_34.89495214
## [581] T0_Amatzia 31.51244878_34.8934848
## [582] T0_Amatzia 31.51440028_34.89825118
## [583] T0_Bat Shlomo Kkl 3
## [584] T0_Eshtaol Kkl 4
## [585] T0_Givat Yeshayahu 2
## [586] T0_Givat Yeshayahu 3
## [587] T0_Kabri 33.02026699_35.15765825
## [588] T0_Kerem Maharal Kkl 3
## [589] T1_Bat Shlomo 32.58547442_35.01415585
## [590] T1_Eshtaol 31.79075347_35.01995897
## [591] T1_Ofer Kkl Plantings 1
## [592] T2_Aderet 31.67867469_34.98154177
## [593] T2_Elyakim 32.66370396_35.05617847
## [594] T2_Kerem Maharal Kkl Plantings 2
## [595] T2_Meron Kkl Plantings 2
## [596] T2_Ofer Kkl Plantings 2
## [597] T3_Eshtaol 31.79075347_35.01995897
## [598] T3_Givat Yeshaayahu Kkl Plantings 1
## [599] T3_Givat Yeshaayahu Kkl Plantings 2
## [600] T3_Ofer Kkl Plantings 2
## [601] T4_Amatzia 31.51244719_34.89349107
## [602] T4_Kerem Maharal Kkl Plantings 1
## [603] T2_Amatzia 31.51244719_34.89349107
## [604] T2_Kerem Maharal Kkl Plantings 3
## [605] T4_Elyakim 32.66705144_35.05568733
## [606] T4_Ofer Kkl Plantings 2
## [607] T4_Ramot Naftali Kkl Plantings 1
## [608] T1_Aderet 31.67867469_34.98154177
## [609] T1_Eitanim 31.77814645_35.10938566
## [610] T1_Manara 33.18276851_35.54829503
## [611] T2_Ramat Hashofet Kkl Plantings 4
## [612] T4_Kerem Maharal Kkl Plantings 3
## [613] T1_Aderet 31.67144877_34.9880248
## [614] T1_Givat Yeshaayahu Kkl Plantings 1
## [615] T1_Givat Yeshaayahu Kkl Plantings 3
## [616] T2_Aderet 31.67144877_34.9880248
## [617] T2_Bat Shlomo Kkl Plantings 1
## [618] T2_Eshtaol 31.79075347_35.01995897
## [619] T2_Givat Yeshaayahu Kkl Plantings 2
## [620] T2_Givat Yeshaayahu Kkl Plantings 3
## [621] T2_Meron Kkl Plantings 1
## [622] T2_Ofer Kkl Plantings 3
## [623] T2_Zuriel Kkl Plantings 1
## [624] T3_Kabri 33.02024909_35.15766172
## [625] T3_Kerem Maharal Kkl Plantings 1
## [626] T3_Manara Kkl Plantings 2
## [627] T3_Ofer Kkl Plantings 1
## [628] T3_Ramot Naftali Kkl Plantings 1
## [629] T4_Aderet 31.67144877_34.9880248
## [630] T4_Givat Yeshaayahu Kkl Plantings 2
## [631] T4_Ofer Kkl Plantings 3
## [632] T4_Ramat Hashofet 32.61710013_35.11234171
## [633] T4_Ramat Hashofet Kkl Plantings 4a
## [634] T0_Manara Kkl 1
## [635] T2_Manara Kkl Plantings 2
## [636] T3_Kerem Maharal Kkl Plantings 3
## [637] T3_Manara Kkl Plantings 3
## [638] T4_Aderet 31.67577723_34.98668826
## [639] T0_Kabri 33.02175836_35.17061209
## [640] T0_Ramot Naftali 33.09475371_35.56140929
## [641] T1_Eitanim 31.77492651_35.09886264
## [642] T1_Meron 32.99189342_35.45548018
## [643] T2_Meron 32.99189342_35.45548018
## [644] T3_Bat Shlomo Kkl Plantings 1
## [645] T4_Kerem Maharal Kkl Plantings 2
## 697 Levels: T0_Aderet 31.67867469_34.98154177 ... T4_Zuriel Kkl Plantings 1a
reptiles[, .(no.of.surveys = uniqueN(survey_ID)), keyby = is.rare.in.unit] # 674 surveys with at least one non-rare species
## is.rare.in.unit no.of.surveys
## 1: FALSE 645
## 2: TRUE 262
reptiles[count_individuals > 0, .(no.of.spp = uniqueN(SciName)), keyby = .(unit, is.rare.in.unit)] # sometimes there are more rare species than non-rare ones
## unit is.rare.in.unit no.of.spp
## 1: Coastal Plain Sands FALSE 9
## 2: Coastal Plain Sands TRUE 11
## 3: Inland Sands FALSE 11
## 4: Inland Sands TRUE 6
## 5: Loess Covered Areas in the Northern Negev FALSE 4
## 6: Loess Covered Areas in the Northern Negev TRUE 19
## 7: Mediterranean-Desert Transition Zone FALSE 8
## 8: Mediterranean-Desert Transition Zone TRUE 19
## 9: Planted Conifer Forests FALSE 6
## 10: Planted Conifer Forests TRUE 17
setorder(reptiles, unit, campaign, subunit, site, conc_lat_lon, survey_ID)
Note the large number of rare species out of the total.
Age of the reptiles
age.dist <- reptiles[observation_type == 'direct', .(total.individuals = sum(count_individuals)), keyby = .(survey_ID, age)]
ggplot(data = age.dist, aes(color = age, x = age, y = total.individuals)) + geom_violin()
ggplot(data = reptiles[count_individuals > 0], aes(color = age, x = age, y = count_individuals)) + geom_jitter(height = 0) + geom_boxplot()
reptiles[count_individuals > 2, .N, keyby = age]
## age N
## 1: <NA> 3
## 2: adult 5
## 3: juvenile 16
## 4: neonate 6
## 5: subadult 9
str(reptiles)
## Classes 'data.table' and 'data.frame': 2718 obs. of 78 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ SciName : chr "Acanthodactylus scutellatus" "Chalcides sepsoides" "Spalerosophis diadema" "Stenodactylus sthenodactylus" ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 18 18 18 18 12 12 12 12 15 15 ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ settlements : Factor w/ 2 levels "Far","Near": 2 2 2 2 1 1 1 1 1 1 ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: 1 1 1 1 1 1 1 1 2 2 ...
## $ observations_id : Factor w/ 428 levels "","00096fb4-2975-409e-8130-d3fb412e27b7",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ latitude : num 31.7 31.7 31.7 31.7 31.8 ...
## $ longitude : num 34.6 34.6 34.6 34.6 34.6 ...
## $ date : Factor w/ 123 levels "01/05/2019","01/06/2020",..: 8 11 8 11 121 121 8 8 121 8 ...
## $ time : Factor w/ 520 levels "10:00:00","10:01:00",..: 153 466 468 466 517 134 513 513 28 26 ...
## $ date_end : Factor w/ 8 levels "","08/07/2021",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ time_end : Factor w/ 53 levels "","10:09","10:10",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ activity : Factor w/ 15 levels "basking","burrowing",..: 8 13 8 13 9 8 13 13 8 13 ...
## $ orientation : Factor w/ 6 levels "between","in",..: 1 NA 6 NA 2 1 NA NA 1 NA ...
## $ type : Factor w/ 35 levels "Acacia","annuals",..: 27 NA 17 NA 20 27 NA NA 27 NA ...
## $ body : int NA NA 285 NA 42 NA NA NA NA NA ...
## $ tail : Factor w/ 38 levels "100","105","13",..: NA NA 27 NA 28 NA NA NA NA NA ...
## $ tail_type : Factor w/ 5 levels "broken","original",..: NA NA NA NA NA NA NA NA NA NA ...
## $ stones_flipped : int NA NA NA NA NA NA NA NA NA NA ...
## $ weather : Factor w/ 28 levels "","אובך","בהיר וחם",..: NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ temp_shade : num NA NA NA NA NA NA NA NA NA NA ...
## $ temp_sun : num NA NA NA NA NA NA NA NA NA NA ...
## $ site_description : Factor w/ 9 levels "","גזם אורנים מתים טרם פונה. נבירות חזירי בר",..: NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ obs_snout_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ obs_tail_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ obs_regentail_len : int NA NA NA NA NA NA NA NA NA NA ...
## $ material : Factor w/ 15 levels "","annuals","bark (tree)",..: NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ obs_notes : Factor w/ 107 levels "","אורך פסיעה 16 ס''מ",..: NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ disturbance : Factor w/ 36 levels "","אשפה, גרוטאות, ערימות חציר",..: NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ sv : int NA NA NA NA NA NA NA NA NA NA ...
## $ t : int NA NA NA NA NA NA NA NA NA NA ...
## $ regen_t : num NA NA NA NA NA NA NA NA NA NA ...
## $ substrate : Factor w/ 18 levels "","annuals","bark (tree)",..: NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ survey_protocol : Factor w/ 3 levels "scan","trail",..: 1 2 1 2 3 1 2 2 1 2 ...
## $ count_individuals : num 2 1 1 1 1 3 1 1 2 1 ...
## $ weather_desc : Factor w/ 7 levels "","clear","cloudy",..: NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ wind : Factor w/ 4 levels "","light","medium",..: NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ sex_new : Factor w/ 3 levels "","female","male": NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ age : Factor w/ 5 levels "","adult","juvenile",..: 5 1 3 1 5 5 1 1 5 1 ...
## $ observation_type : Factor w/ 2 levels "direct","indirect": 1 2 1 2 1 1 2 2 1 2 ...
## $ Column : Factor w/ 7 levels "adult","female",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lat : num 31.7 31.7 31.7 31.7 31.8 ...
## $ mean.lon : num 34.6 34.6 34.6 34.6 34.6 ...
## $ conc_lat_lon : Factor w/ 258 levels "30.915613_34.446467",..: 180 180 180 180 181 181 181 181 182 182 ...
## $ Date : Date, format: "2014-10-01" "2014-10-01" ...
## $ ITime : 'ITime' int 06:59:00 06:59:00 06:59:00 06:59:00 08:43:00 08:43:00 08:43:00 08:43:00 09:30:00 09:30:00 ...
## $ start_Time : 'ITime' int 07:59:00 07:59:00 07:59:00 07:59:00 09:43:00 09:43:00 09:43:00 09:43:00 10:30:00 10:30:00 ...
## $ Date.time : POSIXct, format: "2014-10-01 06:59:00" "2014-10-01 06:59:00" ...
## $ Comments : Factor w/ 5 levels "Coordinates taken from T1 2016 data",..: NA NA NA NA NA NA NA NA NA NA ...
## $ new_plot_id : Factor w/ 168 levels "Aderet 31.67144877_34.9880248",..: NA NA NA NA NA NA NA NA NA NA ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 13 13 13 13 7 7 7 7 10 10 ...
## $ Occurrence : num 1 1 1 1 1 1 1 1 1 1 ...
## $ dist.noon : num 18060 18060 18060 18060 11820 ...
## $ dist.noon.radians : num 1.31 1.31 1.31 1.31 0.86 ...
## $ dist.noon.radians.2h : num 2.63 2.63 2.63 2.63 1.72 ...
## $ sin.dist.noon : num 0.967 0.967 0.967 0.967 0.758 ...
## $ cos.dist.noon : num 0.255 0.255 0.255 0.255 0.653 ...
## $ sin.dist.noon.2h : num 0.492 0.492 0.492 0.492 0.989 ...
## $ cos.dist.noon.2h : num -0.87 -0.87 -0.87 -0.87 -0.148 ...
## $ dist.21.June : num 102 102 102 102 101 101 101 101 101 101 ...
## $ dist.21.June.radians : num 1.76 1.76 1.76 1.76 1.74 ...
## $ dist.21.June.radians.2h: num 3.51 3.51 3.51 3.51 3.48 ...
## $ sin.dist.21.June : num 0.983 0.983 0.983 0.983 0.986 ...
## $ cos.dist.21.June : num -0.184 -0.184 -0.184 -0.184 -0.167 ...
## $ sin.dist.21.June.2h : num -0.362 -0.362 -0.362 -0.362 -0.329 ...
## $ cos.dist.21.June.2h : num -0.932 -0.932 -0.932 -0.932 -0.944 ...
## $ heb_name : Factor w/ 52 levels "ארבע-קו מובהק",..: 49 26 23 16 49 49 26 16 49 26 ...
## $ scaled.temp.shade : num NA NA NA NA NA NA NA NA NA NA ...
## ..- attr(*, "scaled:center")= num 28.3
## ..- attr(*, "scaled:scale")= num 4.64
## $ scaled.temp.sun : num NA NA NA NA NA NA NA NA NA NA ...
## ..- attr(*, "scaled:center")= num 38.6
## ..- attr(*, "scaled:scale")= num 9
## $ track_obs_id : int NA 1 NA 1 NA NA 1 1 NA 1 ...
## $ grp_id : int NA 120 NA 715 NA NA 114 709 NA 117 ...
## $ is.rare.in.unit : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## - attr(*, ".internal.selfref")=<externalptr>
setorder(reptiles, unit, campaign, year, site, settlements, agriculture, habitat, dunes, Date, ITime, mean.lat, conc_lat_lon, SciName,
heb_name) # Make sure the data are ordered reasonably
setcolorder(reptiles, c('unit', 'campaign', 'year', 'site', 'point_name', 'mean.lat', 'mean.lon','settlements', 'agriculture', 'habitat', 'dunes', 'Date',
'ITime', 'SciName', 'heb_name', 'count_individuals')) # Order the columns reasonably
write_excel_csv(reptiles, 'data/wrangled reptile data T0-T4.csv')
save(reptiles, file = 'data/wrangled reptile data T0-T4.Rdata')
List the species per unit:
sp.per.unit <- reptiles[!is.na(SciName), .(total.abundance = sum(count_individuals), no.of.surveys.found = uniqueN(survey_ID)), keyby = .(unit, SciName, heb_name)]
sp.per.unit
## unit SciName heb_name
## 1: Coastal Plain Sands Acanthodactylus aegyptius שנונית מצרית
## 2: Coastal Plain Sands Acanthodactylus boskianus שנונית נחלים
## 3: Coastal Plain Sands Acanthodactylus scutellatus שנונית חולות
## 4: Coastal Plain Sands Chalcides ocellatus נחושית עינונית
## 5: Coastal Plain Sands Chalcides sepsoides נחושית חולות
## ---
## 106: Planted Conifer Forests Ptyodactylus guttatus מניפנית מצויה
## 107: Planted Conifer Forests Ptyodactylus puiseuxi מניפנית גלילית
## 108: Planted Conifer Forests Rhynchocalamus melanocephalus שחור ראש
## 109: Planted Conifer Forests Telescopus fallax עין-חתול חברבר
## 110: Planted Conifer Forests Testudo graeca צב-יבשה מצוי
## total.abundance no.of.surveys.found
## 1: 5 4
## 2: 71 38
## 3: 316 98
## 4: 68 63
## 5: 187 162
## ---
## 106: 2 2
## 107: 4 3
## 108: 3 2
## 109: 1 1
## 110: 7 6
write_excel_csv(sp.per.unit, "Output/Reptile species per unit.csv")
Generate a table of alpha diversity: species richness, total reptile abundance and geometric mean abundance per survey (defined here as a unique plot-campaign combination).
# Species richness
sp.richness.data <- reptiles[count_individuals > 0, .(species.richness = uniqueN(SciName)), keyby = LHS]
sp.richness.data[, uniqueN(survey_ID)] # 630 surveys over all
## [1] 630
sp.richness.data[, .N, keyby = survey_ID][N > 1] # 2 cases of more than one row per survey
## Empty data.table (0 rows and 2 cols): survey_ID,N
sp.richness.data[survey_ID %in% sp.richness.data[, .N, keyby = survey_ID][N > 1, survey_ID]]
## Empty data.table (0 rows and 19 cols): unit,year,campaign,subunit,site,point_name...
reptiles[survey_ID %in% sp.richness.data[, .N, keyby = survey_ID][N > 1, survey_ID], .SD, .SDcols = LHS] # Mean coordinates are NA in two rows in Kerem Maharal Kkl Plantings 1
## Empty data.table (0 rows and 18 cols): unit,year,campaign,subunit,site,point_name...
sp.richness.data[, min(species.richness)] # no zero species richness plots here though
## [1] 1
sp.richness.data <- rbind(sp.richness.data, reptiles[count_individuals == 0, .(species.richness = 0), keyby = LHS]) # add all the zero species richness surveys
sp.richness.data[, uniqueN(survey_ID)] # Now there are 697 surveys
## [1] 697
# Total plot abundance, with rare species
total.abnd <- reptiles[, .(total.abundance = sum(count_individuals)), keyby = LHS]
total.abnd[, uniqueN(survey_ID)] # 697 surveys over all, same as with the species richness
## [1] 697
# Total plot abundance, without rare species
total.abnd.no.rare <- reptiles[is.rare.in.unit == F | count_individuals == 0, .(total.abundance = sum(count_individuals)), keyby = LHS]
total.abnd.no.rare[, uniqueN(survey_ID)] # 645 surveys including only non-rare species
## [1] 645
reptiles[is.rare.in.unit == F, .(total.abundance = sum(count_individuals)), keyby = LHS]
## unit year campaign subunit site
## 1: Coastal Plain Sands 2014 T0 <NA> Ashdod
## 2: Coastal Plain Sands 2014 T0 <NA> Ashdod
## 3: Coastal Plain Sands 2014 T0 <NA> Ashdod
## 4: Coastal Plain Sands 2014 T0 <NA> Ashdod
## 5: Coastal Plain Sands 2014 T0 <NA> Ashdod
## ---
## 641: Planted Conifer Forests 2021 T4 Judean Highlands Eshtaol
## 642: Planted Conifer Forests 2021 T4 Judean Highlands Eshtaol
## 643: Planted Conifer Forests 2021 T4 Judean Highlands Eshtaol
## 644: Planted Conifer Forests 2021 T4 Judean Highlands Givat Yeshayahu
## 645: Planted Conifer Forests 2021 T4 Judean Highlands Givat Yeshayahu
## point_name survey_ID
## 1: Ashdod Far Semi-Shifting 1 T0_Ashdod Far Semi-Shifting 1
## 2: Ashdod Far Semi-Shifting 2 T0_Ashdod Far Semi-Shifting 2
## 3: Ashdod Far Semi-Shifting 3 T0_Ashdod Far Semi-Shifting 3
## 4: Ashdod Far Shifting 1 T0_Ashdod Far Shifting 1
## 5: Ashdod Far Shifting 2 T0_Ashdod Far Shifting 2
## ---
## 641: Eshtaol 31.79075347_35.01995897 T4_Eshtaol 31.79075347_35.01995897
## 642: Eshtaol Kkl Plantings 3 T4_Eshtaol Kkl Plantings 3
## 643: Eshtaol Kkl Plantings 4 T4_Eshtaol Kkl Plantings 4
## 644: Givat Yeshaayahu Kkl Plantings 2 T4_Givat Yeshaayahu Kkl Plantings 2
## 645: Givat Yeshaayahu Kkl Plantings 3 T4_Givat Yeshaayahu Kkl Plantings 3
## Date sin.dist.21.June cos.dist.21.June sin.dist.noon cos.dist.noon
## 1: 2014-09-30 0.9859481 -0.1670516 0.75756498 0.6527598
## 2: 2014-09-30 0.9859481 -0.1670516 0.38268343 0.9238795
## 3: 2014-09-30 0.9859481 -0.1670516 0.67880075 0.7343225
## 4: 2014-09-30 0.9859481 -0.1670516 0.60876143 0.7933533
## 5: 2014-09-30 0.9859481 -0.1670516 0.54829323 0.8362862
## ---
## 641: 2021-04-08 -0.9562348 0.2926003 0.73432251 0.6788007
## 642: 2021-04-08 -0.9562348 0.2926003 0.60876143 0.7933533
## 643: 2021-04-08 -0.9562348 0.2926003 0.46947156 0.8829476
## 644: 2021-05-26 -0.4327756 0.9015017 0.08715574 0.9961947
## 645: 2021-05-26 -0.4327756 0.9015017 -0.22495105 0.9743701
## settlements agriculture dunes habitat mean.lon mean.lat
## 1: Far <NA> semi-shifting <NA> 34.61184 31.75179
## 2: Far <NA> semi-shifting <NA> 34.63104 31.75970
## 3: Far <NA> semi-shifting <NA> 34.61867 31.76023
## 4: Far <NA> shifting <NA> 34.62451 31.75772
## 5: Far <NA> shifting <NA> 34.62451 31.75975
## ---
## 641: <NA> <NA> <NA> <NA> 35.01996 31.79075
## 642: <NA> <NA> <NA> <NA> 35.02194 31.78694
## 643: <NA> <NA> <NA> <NA> 35.02057 31.78378
## 644: <NA> <NA> <NA> <NA> 34.92544 31.66774
## 645: <NA> <NA> <NA> <NA> 34.91740 31.66540
## total.abundance
## 1: 6
## 2: 7
## 3: 17
## 4: 5
## 5: 6
## ---
## 641: 1
## 642: 2
## 643: 1
## 644: 1
## 645: 1
# geometric mean abundance, without rare species - THIS IS IRRELEVANT AS WE DECIDED NOT TO CALCULATE GMA
rept.total.abnd.per.sp <- reptiles[is.rare.in.unit == F, .(Total.sp.abnd = sum(count_individuals, na.rm = T)),
keyby = c(LHS, 'SciName')]
rept.total.abnd.per.sp[!is.na(Total.sp.abnd) & Total.sp.abnd > 0, uniqueN(survey_ID)] # 578 surveys including non-rare species
## [1] 578
gma.no.rare <- rept.total.abnd.per.sp[, .(geom.mean.abundance = exp(mean(log(Total.sp.abnd)))), keyby = c(LHS)]
gma.no.rare[, uniqueN(survey_ID)] # 640 surveys including non-rare species
## [1] 645
reptiles[, .(total.count = sum(count_individuals)), keyby = .(unit, is.rare.in.unit)] # Note that rare species consist a considerable portion of the data
## unit is.rare.in.unit total.count
## 1: Coastal Plain Sands FALSE 1015
## 2: Coastal Plain Sands TRUE 67
## 3: Inland Sands FALSE 567
## 4: Inland Sands TRUE 27
## 5: Loess Covered Areas in the Northern Negev FALSE 147
## 6: Loess Covered Areas in the Northern Negev TRUE 136
## 7: Mediterranean-Desert Transition Zone FALSE 328
## 8: Mediterranean-Desert Transition Zone TRUE 81
## 9: Planted Conifer Forests FALSE 388
## 10: Planted Conifer Forests TRUE 93
# Define a table of all three alpha diversity indices:
alpha.div <- merge(sp.richness.data, total.abnd, by = LHS, all = T) # merge species richness and total plot abundance (including rare species)
alpha.div <- merge(alpha.div, gma.no.rare, by = LHS, all = T) # add also geometric mean abundance (omitting rare species)
# alpha.div <- merge(alpha.div, reptiles[, .(year = unique(year)), keyby = .(unit, campaign)], by = c('unit', 'campaign'), all.x = T) # add the first year of the campaign
alpha.div[, ':=' (year.count = year - min(year), year.fct = as.factor(year)), keyby = unit]
alpha.div[, .(first.year = min(year), first.year.count = min(year.count)), keyby = unit]
## unit first.year first.year.count
## 1: Coastal Plain Sands 2014 0
## 2: Inland Sands 2017 0
## 3: Loess Covered Areas in the Northern Negev 2014 0
## 4: Mediterranean-Desert Transition Zone 2014 0
## 5: Planted Conifer Forests 2014 0
alpha.div[is.na(species.richness), .N] # no cases of missing species richness
## [1] 0
alpha.div[is.na(total.abundance), .N] # no cases of missing total abundance
## [1] 0
alpha.div[is.na(geom.mean.abundance), .N] # 53 cases of missing geometric mean abundance, though!
## [1] 52
alpha.div[is.na(geom.mean.abundance) & !survey_ID %in% reptiles[is.rare.in.unit == T, survey_ID], ] # all of them in surveys where only rare species were found
## Empty data.table (0 rows and 23 cols): unit,year,campaign,subunit,site,point_name...
reptiles[survey_ID %in% alpha.div[is.na(geom.mean.abundance), survey_ID] & is.rare.in.unit == F,
.(survey_ID, SciName, count_individuals, is.rare.in.unit)]
## Empty data.table (0 rows and 4 cols): survey_ID,SciName,count_individuals,is.rare.in.unit
rept.total.abnd.per.sp[survey_ID %in% alpha.div[is.na(geom.mean.abundance), survey_ID],
.(survey_ID, SciName, Total.sp.abnd)] #
## Empty data.table (0 rows and 3 cols): survey_ID,SciName,Total.sp.abnd
gma.no.rare[is.na(geom.mean.abundance), unique(survey_ID)]
## factor()
## 697 Levels: T0_Aderet 31.67867469_34.98154177 ... T4_Zuriel Kkl Plantings 1a
alpha.div[, .(no.of.surveys = uniqueN(survey_ID))] # 697 surveys
## no.of.surveys
## 1: 697
alpha.div[, .(no.of.surveys = uniqueN(survey_ID)), keyby = unit] # 5 units
## unit no.of.surveys
## 1: Coastal Plain Sands 170
## 2: Inland Sands 72
## 3: Loess Covered Areas in the Northern Negev 112
## 4: Mediterranean-Desert Transition Zone 119
## 5: Planted Conifer Forests 224
str(alpha.div)
## Classes 'data.table' and 'data.frame': 697 obs. of 23 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 3 3 3 3 3 3 3 3 3 4 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 12 13 14 15 16 17 18 19 20 21 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 7 8 9 10 11 12 13 14 15 16 ...
## $ Date : Date, format: "2014-09-30" "2014-09-30" ...
## $ sin.dist.21.June : num 0.986 0.986 0.986 0.986 0.986 ...
## $ cos.dist.21.June : num -0.167 -0.167 -0.167 -0.167 -0.167 ...
## $ sin.dist.noon : num 0.758 0.383 0.679 0.609 0.548 ...
## $ cos.dist.noon : num 0.653 0.924 0.734 0.793 0.836 ...
## $ settlements : Factor w/ 2 levels "Far","Near": 1 1 1 1 1 1 2 2 2 1 ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: 1 1 1 2 2 2 1 1 1 1 ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num 34.6 34.6 34.6 34.6 34.6 ...
## $ mean.lat : num 31.8 31.8 31.8 31.8 31.8 ...
## $ species.richness : num 3 4 3 3 3 4 4 3 4 6 ...
## $ total.abundance : num 6 7 17 5 6 6 5 4 5 9 ...
## $ geom.mean.abundance: num 1.59 1.57 2.47 1.59 1.59 ...
## $ year.count : num 0 0 0 0 0 0 0 0 0 0 ...
## $ year.fct : Factor w/ 8 levels "2014","2015",..: 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "sorted")= chr "unit"
## - attr(*, ".internal.selfref")=<externalptr>
GGally::ggpairs(alpha.div[, .(unit, year.count, sin.dist.21.June, species.richness, total.abundance)], progress = F) # species richness and total abundance are highly correlated (0.82)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Species richness data exploration:
### Coastal Plain Dunes----
# Biodiversity indices - Coastal Plain Dunes----
reptiles[unit %like% 'Coast' & !is.na(SciName), .(total.abnd = sum(count_individuals), total.sp.rich = uniqueN(SciName))]
## total.abnd total.sp.rich
## 1: 1082 20
reptiles[unit %like% 'Coast', .(no.of.surveys = uniqueN(survey_ID)), keyby = .(year, campaign, site, dunes, settlements)]
## year campaign site dunes settlements no.of.surveys
## 1: 2014 T0 Ashdod semi-shifting Far 3
## 2: 2014 T0 Ashdod semi-shifting Near 3
## 3: 2014 T0 Ashdod shifting Far 3
## 4: 2014 T0 Ashkelon semi-shifting Far 3
## 5: 2014 T0 Ashkelon semi-shifting Near 3
## 6: 2014 T0 Ashkelon shifting Far 3
## 7: 2014 T0 Netiv Haasara semi-shifting Far 3
## 8: 2014 T0 Netiv Haasara semi-shifting Near 3
## 9: 2014 T0 Netiv Haasara shifting Far 3
## 10: 2015 T1 Ashdod semi-shifting Far 3
## 11: 2015 T1 Ashdod semi-shifting Near 3
## 12: 2015 T1 Ashdod shifting Far 3
## 13: 2015 T1 Ashkelon semi-shifting Far 3
## 14: 2015 T1 Ashkelon semi-shifting Near 3
## 15: 2015 T1 Ashkelon shifting Far 3
## 16: 2015 T1 Caesarea semi-shifting Far 3
## 17: 2015 T1 Caesarea semi-shifting Near 3
## 18: 2015 T1 Caesarea shifting Far 3
## 19: 2015 T1 Zikim semi-shifting Far 3
## 20: 2015 T1 Zikim semi-shifting Near 3
## 21: 2015 T1 Zikim shifting Far 3
## 22: 2017 T2 Ashdod semi-shifting Far 3
## 23: 2017 T2 Ashdod semi-shifting Near 3
## 24: 2017 T2 Ashdod shifting Far 3
## 25: 2017 T2 Ashkelon semi-shifting Far 3
## 26: 2017 T2 Ashkelon semi-shifting Near 3
## 27: 2017 T2 Ashkelon shifting Far 3
## 28: 2017 T2 Caesarea semi-shifting Far 3
## 29: 2017 T2 Caesarea semi-shifting Near 3
## 30: 2017 T2 Caesarea shifting Far 3
## 31: 2017 T2 Zikim semi-shifting Far 3
## 32: 2017 T2 Zikim semi-shifting Near 3
## 33: 2017 T2 Zikim shifting Far 3
## 34: 2019 T3 Ashdod semi-shifting Far 3
## 35: 2019 T3 Ashdod semi-shifting Near 3
## 36: 2019 T3 Ashdod shifting Far 3
## 37: 2019 T3 Ashkelon semi-shifting Far 3
## 38: 2019 T3 Ashkelon semi-shifting Near 3
## 39: 2019 T3 Ashkelon shifting Far 3
## 40: 2019 T3 Caesarea semi-shifting Far 3
## 41: 2019 T3 Caesarea semi-shifting Near 2
## 42: 2019 T3 Caesarea shifting Far 3
## 43: 2019 T3 Zikim semi-shifting Far 3
## 44: 2019 T3 Zikim semi-shifting Near 3
## 45: 2019 T3 Zikim shifting Far 3
## 46: 2021 T4 Ashdod semi-shifting Far 3
## 47: 2021 T4 Ashdod semi-shifting Near 3
## 48: 2021 T4 Ashdod shifting Far 3
## 49: 2021 T4 Ashkelon semi-shifting Far 3
## 50: 2021 T4 Ashkelon semi-shifting Near 3
## 51: 2021 T4 Ashkelon shifting Far 3
## 52: 2021 T4 Caesarea semi-shifting Far 3
## 53: 2021 T4 Caesarea semi-shifting Near 3
## 54: 2021 T4 Caesarea shifting Far 3
## 55: 2021 T4 Zikim semi-shifting Far 3
## 56: 2021 T4 Zikim semi-shifting Near 3
## 57: 2021 T4 Zikim shifting Far 3
## year campaign site dunes settlements no.of.surveys
coast <- alpha.div[unit == 'Coastal Plain Sands'] # subset the coast plain sands
str(coast)
## Classes 'data.table' and 'data.frame': 170 obs. of 23 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 3 3 3 3 3 3 3 3 3 4 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 12 13 14 15 16 17 18 19 20 21 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 7 8 9 10 11 12 13 14 15 16 ...
## $ Date : Date, format: "2014-09-30" "2014-09-30" ...
## $ sin.dist.21.June : num 0.986 0.986 0.986 0.986 0.986 ...
## $ cos.dist.21.June : num -0.167 -0.167 -0.167 -0.167 -0.167 ...
## $ sin.dist.noon : num 0.758 0.383 0.679 0.609 0.548 ...
## $ cos.dist.noon : num 0.653 0.924 0.734 0.793 0.836 ...
## $ settlements : Factor w/ 2 levels "Far","Near": 1 1 1 1 1 1 2 2 2 1 ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: 1 1 1 2 2 2 1 1 1 1 ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num 34.6 34.6 34.6 34.6 34.6 ...
## $ mean.lat : num 31.8 31.8 31.8 31.8 31.8 ...
## $ species.richness : num 3 4 3 3 3 4 4 3 4 6 ...
## $ total.abundance : num 6 7 17 5 6 6 5 4 5 9 ...
## $ geom.mean.abundance: num 1.59 1.57 2.47 1.59 1.59 ...
## $ year.count : num 0 0 0 0 0 0 0 0 0 0 ...
## $ year.fct : Factor w/ 8 levels "2014","2015",..: 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "sorted")= chr "unit"
## - attr(*, ".internal.selfref")=<externalptr>
coast[is.na(settlements) | is.na(dunes)] # no missing variables
## Empty data.table (0 rows and 23 cols): unit,year,campaign,subunit,site,point_name...
GGally::ggpairs(coast[, .(dunes, settlements, year.count, sin.dist.21.June, cos.dist.21.June, # we do not include the time of day in the sands protocol as it includes both morning and afternoon survey in the same plot
species.richness, total.abundance)], progress = F)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
# Dot plots
coast.sp.rich.dotplot <- ggplot(data = coast, aes(x = species.richness, y = site)) +
geom_point(aes(color = dunes, shape = settlements)) + geom_line(aes(group = site)) +
facet_grid(campaign ~ ., scales = 'free_y') + labs(title = 'Reptile Species Richness in the Coastal Sands', y = 'Site', x = 'Species Richness', color = 'Dune Type', shape = 'Proximity to settlements') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, coast[, max(species.richness) + 1]),
breaks = seq(0, coast[, max(species.richness) + 1], by = 2)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
coast.sp.rich.dotplot
ggsave('Figures/Reptile species richness in the coastal sands - dotplot.png', plot = coast.sp.rich.dotplot)
## Saving 7 x 5 in image
# The relevant predictors are distance to settlement, dunes, and temporal trend
# Plot species richness
ggplot(data = coast, aes(x = dunes, color = settlements, y = species.richness)) + geom_boxplot() +
geom_jitter(height = 0, width = 0.3) + facet_wrap(. ~ year) + theme_bw()
# There are no semi-shifting dunes in near plots - this might be problematic with the model; 2014-2015 seem lower than the later years
The models are rank-deficient: in the Near plots there are only semi-shifting dunes (this is the study design). Also note the site identities:
coast[, sort(unique(site))]
## [1] Ashdod Ashkelon Caesarea Netiv Haasara Zikim
## 35 Levels: Aderet Amatzia Ashdod Ashkelon Bat Shlomo Beer Milka ... Zuriel
Following the practice for arthropods recommended by Ittai Renan and a similar recommendation by Ron Chen, we will replace the site identity with a comparison between the northern Coastal Plain dunes (represented only by Caesarea) and the southern ones (all other sites):
coast[, Region := ifelse(site == 'Caesarea', 'North', 'South')]
coast[, .(site = sort(unique(site))), keyby = Region]
## Region site
## 1: North Caesarea
## 2: South Ashdod
## 3: South Ashkelon
## 4: South Netiv Haasara
## 5: South Zikim
Now, as the Region predictor has only two levels (North or South), we cannot treat it as a random predictor. Instead, it will be treated as a fixed predictor that will not be allowed to drop due to AIC.
Species richness model selection:
# Coastal Dunes species richness - glmm model selection ----
coast[, .(mean.species.richness = mean(species.richness), var.sp.rich = var(species.richness)), keyby = .(year)] # 2014-2015 are lower
## year mean.species.richness var.sp.rich
## 1: 2014 3.629630 1.6267806
## 2: 2015 3.416667 0.9357143
## 3: 2017 5.777778 2.1777778
## 4: 2019 5.114286 1.4571429
## 5: 2021 4.611111 2.9301587
coast[, .(mean.species.richness = mean(species.richness), var.sp.rich = var(species.richness)), keyby = .(settlements)] # same
## settlements mean.species.richness var.sp.rich
## 1: Far 4.517544 2.340397
## 2: Near 4.625000 3.147727
coast[, .(mean.species.richness = mean(species.richness), var.sp.rich = var(species.richness)), keyby = .(dunes)] # same
## dunes mean.species.richness var.sp.rich
## 1: semi-shifting 4.646018 2.605721
## 2: shifting 4.368421 2.558271
coast[, .(mean.species.richness = mean(species.richness), var.sp.rich = var(species.richness)), keyby = .(site)] # Netiv Haasara is lower than the rest at 3.3 species vs. 4-5
## site mean.species.richness var.sp.rich
## 1: Ashdod 4.511111 1.801010
## 2: Ashkelon 5.022222 3.931313
## 3: Caesarea 4.171429 1.440336
## 4: Netiv Haasara 3.333333 1.250000
## 5: Zikim 4.694444 2.789683
coast[, .(mean.richness = mean(species.richness), var.richness = var(species.richness))] # var < mean -> try Poisson models
## mean.richness var.richness
## 1: 4.552941 2.591855
# Full model, Poisson response
coast.sp.rich.model.full.Poisson <- glmmTMB(species.richness ~ settlements * dunes + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
summary(coast.sp.rich.model.full.Poisson)
## Family: poisson ( log )
## Formula:
## species.richness ~ settlements * dunes + sin.dist.21.June + cos.dist.21.June +
## Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 644.5 663.3 -316.2 632.5 164
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.26524 0.38829 3.259 0.001120 **
## settlementsNear -0.01372 0.08730 -0.157 0.875129
## dunesshifting -0.07002 0.08819 -0.794 0.427186
## sin.dist.21.June 0.14771 0.39866 0.371 0.711009
## cos.dist.21.June 0.47091 0.12717 3.703 0.000213 ***
## RegionSouth 0.09175 0.09279 0.989 0.322763
## settlementsNear:dunesshifting NA NA NA NA
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat('PHI = '); deviance(coast.sp.rich.model.full.Poisson)/df.residual(coast.sp.rich.model.full.Poisson)
## PHI =
## [1] 0.4037897
drop1(coast.sp.rich.model.full.Poisson) # can drop sin seasonality
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
## Single term deletions
##
## Model:
## species.richness ~ settlements * dunes + sin.dist.21.June + cos.dist.21.June +
## Region
## Df AIC
## <none> 644.48
## sin.dist.21.June 1 642.62
## cos.dist.21.June 1 656.86
## Region 1 643.47
## settlements:dunes 0 644.48
PHI (deviance(Poisson model)/df.residual(Poisson model)) < 1 so we prefer the Poisson models. We get warnings of rank deficiency and cannot obtain any AIC score without omitting the interaction between settlements and dune type. So, we fit models without this interaction:
coast.sp.rich.model1 <- glmmTMB(species.richness ~ settlements + dunes + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.sp.rich.model1)
## Family: poisson ( log )
## Formula:
## species.richness ~ settlements + dunes + sin.dist.21.June + cos.dist.21.June +
## Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 644.5 663.3 -316.2 632.5 164
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.26524 0.38829 3.259 0.001120 **
## settlementsNear -0.01372 0.08730 -0.157 0.875129
## dunesshifting -0.07002 0.08819 -0.794 0.427186
## sin.dist.21.June 0.14771 0.39866 0.371 0.711009
## cos.dist.21.June 0.47091 0.12717 3.703 0.000213 ***
## RegionSouth 0.09175 0.09279 0.989 0.322763
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.sp.rich.model1)
## Single term deletions
##
## Model:
## species.richness ~ settlements + dunes + sin.dist.21.June + cos.dist.21.June +
## Region
## Df AIC
## <none> 644.48
## settlements 1 642.50
## dunes 1 643.11
## sin.dist.21.June 1 642.62
## cos.dist.21.June 1 656.86
## Region 1 643.47
Now we have an AIC score (644.5) and no warnings. The function drop1 suggests we can further drop the distance to settlements. Proceed to dropping predictors one by one due to AIC selection:
coast.sp.rich.model2 <- glmmTMB(species.richness ~ dunes + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.sp.rich.model2)
## Family: poisson ( log )
## Formula:
## species.richness ~ dunes + sin.dist.21.June + cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 642.5 658.2 -316.3 632.5 165
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.25893 0.38622 3.260 0.001116 **
## dunesshifting -0.06323 0.07696 -0.822 0.411267
## sin.dist.21.June 0.14734 0.39865 0.370 0.711681
## cos.dist.21.June 0.47073 0.12716 3.702 0.000214 ***
## RegionSouth 0.09159 0.09278 0.987 0.323571
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.sp.rich.model2)
## Single term deletions
##
## Model:
## species.richness ~ dunes + sin.dist.21.June + cos.dist.21.June +
## Region
## Df AIC
## <none> 642.50
## dunes 1 641.18
## sin.dist.21.June 1 640.64
## cos.dist.21.June 1 654.87
## Region 1 641.50
AIC has decreased and can be further decreased if we drop sine seasonality as well:
coast.sp.rich.model3 <- glmmTMB(species.richness ~ dunes + cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.sp.rich.model3)
## Family: poisson ( log )
## Formula: species.richness ~ dunes + cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 640.6 653.2 -316.3 632.6 166
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.39789 0.08746 15.984 < 2e-16 ***
## dunesshifting -0.06286 0.07695 -0.817 0.414
## cos.dist.21.June 0.43570 0.08433 5.166 2.39e-07 ***
## RegionSouth 0.08712 0.09201 0.947 0.344
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.sp.rich.model3)
## Single term deletions
##
## Model:
## species.richness ~ dunes + cos.dist.21.June + Region
## Df AIC
## <none> 640.64
## dunes 1 639.31
## cos.dist.21.June 1 665.30
## Region 1 639.55
We can drop the dune type too:
coast.sp.rich.model4 <- glmmTMB(species.richness ~ cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.sp.rich.model4)
## Family: poisson ( log )
## Formula: species.richness ~ cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 639.3 648.7 -316.7 633.3 167
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.37681 0.08372 16.445 < 2e-16 ***
## cos.dist.21.June 0.43542 0.08435 5.162 2.44e-07 ***
## RegionSouth 0.08772 0.09201 0.953 0.34
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.sp.rich.model4)
## Single term deletions
##
## Model:
## species.richness ~ cos.dist.21.June + Region
## Df AIC
## <none> 639.31
## cos.dist.21.June 1 663.93
## Region 1 638.24
Although AIC can be lowered by removing the Region as well, we refrain from doing so as it is a substitute for the site (and plot) identities and is part of the study design. Hence, we have selected our final model, and now we should draw the model diagnostics:
# The chosen model is coast.sp.rich.model4 (seasonal and diel patterns)
summary(coast.sp.rich.model4)
## Family: poisson ( log )
## Formula: species.richness ~ cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 639.3 648.7 -316.7 633.3 167
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.37681 0.08372 16.445 < 2e-16 ***
## cos.dist.21.June 0.43542 0.08435 5.162 2.44e-07 ***
## RegionSouth 0.08772 0.09201 0.953 0.34
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coast.sp.rich.sim.res <- simulateResiduals(coast.sp.rich.model4) # simulate the residuals using DHARMa package for model diagnostics
plot(coast.sp.rich.sim.res)# The quantile, KS and dispersion tests are significant
png('Analysis/Model diagnostics/Coastal Plain species richness QQ plot.png') # Export the QQ plot
plot(coast.sp.rich.sim.res)
dev.off()
## png
## 2
The QQ plot does not look good: the Kolmogorov-Smirnov test is significant (meaning the data came from a different distribution than the model’s) and the dispersion test is significant as well. That might mean either over-dispersion (meaning increased type I error rate) or under-dispersion (meaning increased type II error, i.e. lower statistical power). We should investigate which one is it. In addition, the scaled residuals (scaled from 0 to 1, where 0 meaning all observed values are higher than the prediction and 1 meaning all observed values are lower than the predictions) test significant. Let’s further explore these issues:
testQuantiles(coast.sp.rich.sim.res, plot = F) #
##
## Test for location of quantiles via qgam
##
## data: coast.sp.rich.sim.res
## p-value = 3.053e-06
## alternative hypothesis: both
hist(coast.sp.rich.sim.res$fittedResiduals) # right-tailed distribution
quantile(coast.sp.rich.sim.res$fittedResiduals) # median residual = -0.21; inter-quartile range for residuals is -0.77 to +0.77
## 0% 25% 50% 75% 100%
## -2.9631933 -0.9655888 -0.1433060 0.7687454 4.7308806
testDispersion(coast.sp.rich.sim.res, alternative = 'less') # Significant (p < 2.2e-16) -> underdispersion
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.4043, p-value < 2.2e-16
## alternative hypothesis: less
testDispersion(coast.sp.rich.sim.res, alternative = 'greater', plot = F) # Insignificant (p = 1) -> not overdispersion
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.4043, p-value = 1
## alternative hypothesis: greater
testZeroInflation(coast.sp.rich.sim.res, alternative = 'greater') # p = 1, meaning there is no zero-inflation
##
## DHARMa zero-inflation test via comparison to expected zeros with
## simulation under H0 = fitted model
##
## data: simulationOutput
## ratioObsSim = 0, p-value = 1
## alternative hypothesis: greater
testZeroInflation(coast.sp.rich.sim.res, alternative = 'less', plot = F) # Significant (p = 0.04) -> fewer zeroes than expected
##
## DHARMa zero-inflation test via comparison to expected zeros with
## simulation under H0 = fitted model
##
## data: simulationOutput
## ratioObsSim = 0, p-value = 0.068
## alternative hypothesis: less
coast.sp.rich.model4b <- glmmTMB(species.richness ~ cos.dist.21.June + Region, family = 'poisson', data = coast, ziformula = ~ cos.dist.21.June + Region) # try correcting for zero-inflation
summary(coast.sp.rich.model4b) # AIC = 645.3 - getting worse!
## Family: poisson ( log )
## Formula: species.richness ~ cos.dist.21.June + Region
## Zero inflation: ~cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 645.3 664.1 -316.7 633.3 164
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.37681 0.08372 16.445 < 2e-16 ***
## cos.dist.21.June 0.43542 0.08435 5.162 2.44e-07 ***
## RegionSouth 0.08772 0.09201 0.953 0.34
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Zero-inflation model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.239e+01 1.234e+04 -0.002 0.999
## cos.dist.21.June -2.825e-03 1.227e+04 0.000 1.000
## RegionSouth 1.776e-01 1.357e+04 0.000 1.000
We found that the data are under-dispersed (i.e. lower statistical power) and also that there are less zeroes than expected (p = 0.052 - marginally insignificant). Nevertheless, including zero inflation in the model formula did not improve model fit reduced it. Let’s document the AIC and BIC of all examined models as an R data.table and export it as a csv for future reference:
file.remove('Analysis/Coastal Dunes - species richness model selection.txt')
## [1] TRUE
for (model in c(ls()[grep('*coast.sp.rich.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/Coastal Dunes - species richness model selection.txt', append = T)
}
# load('Analysis/Coast Dunes - Species richness models.Rdata')
save(list = ls()[grep('*coast.sp.rich.model', ls())], file = 'Analysis/Coast Dunes - Species richness models.Rdata') # back up the models
capture.output(cat('The best fitting model for species richness in the Coastal Dunes is coast.sp.rich.model4.'),
summary(coast.sp.rich.model4), cat('\n----\nNote that the model is underdispersed (i.e. has low power):\n'),
testDispersion(coast.sp.rich.sim.res, alternative = 'less', plot = F), # Significant (p < 2.2e-16) -> underdispersion
testDispersion(coast.sp.rich.sim.res, alternative = 'greater', plot = F), # Insignificant (p = 1) -> not overdispersion
testZeroInflation(coast.sp.rich.sim.res, alternative = 'greater', plot = F), # p = 1, meaning there is no zero-inflation
testZeroInflation(coast.sp.rich.sim.res, alternative = 'less', plot = F), # Significant (p < 2.2e-16) -> fewer zeroes than expected
file = 'Output/Coastal Dunes species richness - best fitting model.txt', append = F)
# Create a table comparing total abundance models:
sp.rich.comparison <- data.table(unit = '', model = '', data = '', family = '', formula = '', no.of.preds = 0, AIC = 0, BIC = 0) # Create a data.table to be filled by a loop
sp.rich.comparison <- sp.rich.comparison[AIC > 0] # empty the data.table
for(model in ls()[grep('*coast.sp.rich.model.', ls())]){
sp.rich.comparison <- rbind(sp.rich.comparison,
data.table(unit = 'Coast Sands', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
sp.rich.comparison <- sp.rich.comparison[!(formula %like% '~' | formula %like% 'species.richness')] # remove redundant rows
sp.rich.comparison <- unique(sp.rich.comparison)
setorder(sp.rich.comparison, unit, AIC) # Sort by AIC (ascending)
sp.rich.comparison[unit == 'Coast Sands'] # View the table
## unit model data family
## 1: Coast Sands coast.sp.rich.model4 coast poisson
## 2: Coast Sands coast.sp.rich.model3 coast poisson
## 3: Coast Sands coast.sp.rich.model2 coast poisson
## 4: Coast Sands coast.sp.rich.model.full.Poisson coast poisson
## 5: Coast Sands coast.sp.rich.model1 coast poisson
## 6: Coast Sands coast.sp.rich.model4b coast poisson
## formula
## 1: cos.dist.21.June + Region
## 2: dunes + cos.dist.21.June + Region
## 3: dunes + sin.dist.21.June + cos.dist.21.June + Region
## 4: settlements * dunes + sin.dist.21.June + cos.dist.21.June + Region
## 5: settlements + dunes + sin.dist.21.June + cos.dist.21.June + Region
## 6: cos.dist.21.June + Region
## no.of.preds AIC BIC
## 1: 2 639.3128 648.7202
## 2: 3 640.6405 653.1837
## 3: 4 642.5035 658.1825
## 4: 6 644.4788 663.2936
## 5: 5 644.4788 663.2936
## 6: 2 645.3128 664.1276
write_excel_csv(sp.rich.comparison, file = 'Analysis/Species richness models of reptiles - AIC comparison.csv')
Once we are done with the models not chosen, we can remove them from memory:
rm(list = setdiff(ls()[grep('*coast.sp.rich.model', ls())], c('coast.sp.rich.model4'))) # Clean up
We do not bother predicting the species richness in the coastal plain since the chosen model contained no researcher hypotheses. Proceed to analyzing total reptile abundance:
Some data exploration:
# Coastal Dunes total abundance - glmm model selection ----
coast.abnd.dotplot <- ggplot(data = coast, aes(x = total.abundance, y = site)) +
geom_point(aes(color = dunes, shape = settlements)) + geom_line(aes(group = site)) +
facet_grid(campaign ~ ., scales = 'free_y') + labs(title = 'Reptile Total Abundance in the Coastal Sands', y = 'Site', x = 'Total Abundance', color = 'Dune Type', shape = 'Proximity to settlements') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, coast[, max(total.abundance) + 1]),
breaks = seq(0, coast[, max(total.abundance) + 1], by = 2)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
coast.abnd.dotplot
ggsave('Figures/Reptile Total Abundance in the coastal sands - dotplot.png', plot = coast.abnd.dotplot)
## Saving 7 x 5 in image
str(coast)
## Classes 'data.table' and 'data.frame': 170 obs. of 24 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 3 3 3 3 3 3 3 3 3 4 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 12 13 14 15 16 17 18 19 20 21 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 7 8 9 10 11 12 13 14 15 16 ...
## $ Date : Date, format: "2014-09-30" "2014-09-30" ...
## $ sin.dist.21.June : num 0.986 0.986 0.986 0.986 0.986 ...
## $ cos.dist.21.June : num -0.167 -0.167 -0.167 -0.167 -0.167 ...
## $ sin.dist.noon : num 0.758 0.383 0.679 0.609 0.548 ...
## $ cos.dist.noon : num 0.653 0.924 0.734 0.793 0.836 ...
## $ settlements : Factor w/ 2 levels "Far","Near": 1 1 1 1 1 1 2 2 2 1 ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: 1 1 1 2 2 2 1 1 1 1 ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num 34.6 34.6 34.6 34.6 34.6 ...
## $ mean.lat : num 31.8 31.8 31.8 31.8 31.8 ...
## $ species.richness : num 3 4 3 3 3 4 4 3 4 6 ...
## $ total.abundance : num 6 7 17 5 6 6 5 4 5 9 ...
## $ geom.mean.abundance: num 1.59 1.57 2.47 1.59 1.59 ...
## $ year.count : num 0 0 0 0 0 0 0 0 0 0 ...
## $ year.fct : Factor w/ 8 levels "2014","2015",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Region : chr "South" "South" "South" "South" ...
## - attr(*, "sorted")= chr "unit"
## - attr(*, ".internal.selfref")=<externalptr>
coast[, .(mean.abundance = mean(total.abundance, na.rm = T), var.abundance = var(total.abundance, na.rm = T))] # var >> mean -> try negative binomial
## mean.abundance var.abundance
## 1: 6.364706 10.2449
ggplot(data = coast, aes(x = dunes, color = settlements, y = total.abundance)) + geom_boxplot() + labs(title = 'Coastal Sands Reptiles') + geom_jitter(height = 0, width = 0.3) + facet_wrap(. ~ year) + theme_bw() # 2017-2019 seem higher than the other years
ggsave('Analysis/Coastal Sands total reptile abundance - observations.png')
## Saving 7 x 5 in image
Ashdod semi-shifting Far in T0 and in T3 had counts of 17(!) reptiles, which seems like too much. Let’s have a look at that:
reptiles[site == 'Ashdod' & campaign %in% c('T0', 'T3') & settlements == 'Far' & dunes == 'semi-shifting', .(total.individuals = sum(count_individuals)), keyby = .(survey_ID, campaign, Date)]
## survey_ID campaign Date total.individuals
## 1: T0_Ashdod Far Semi-Shifting 1 T0 2014-09-30 6
## 2: T0_Ashdod Far Semi-Shifting 2 T0 2014-09-30 7
## 3: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30 17
## 4: T3_Ashdod Far Semi-Shifting 1 T3 2019-08-25 9
## 5: T3_Ashdod Far Semi-Shifting 2 T3 2019-08-25 6
## 6: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25 17
In both cases this is T3_Ashdod Far Semi-Shifting 3.
reptiles[point_name == 'Ashdod Far Semi-Shifting 3' & campaign %in% c('T0', 'T3'), .(total.ind = sum(count_individuals)), keyby = .(survey_ID, campaign, Date, SciName, heb_name)]
## survey_ID campaign Date
## 1: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 2: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 3: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 4: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 5: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 6: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 7: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 8: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 9: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## SciName heb_name total.ind
## 1: Acanthodactylus scutellatus שנונית חולות 15
## 2: Chalcides sepsoides נחושית חולות 1
## 3: Stenodactylus sthenodactylus ישימונית מצויה 1
## 4: Acanthodactylus scutellatus שנונית חולות 12
## 5: Chalcides ocellatus נחושית עינונית 1
## 6: Chalcides sepsoides נחושית חולות 1
## 7: Macroprotodon cucullatus נחש כיפה 1
## 8: Psammophis schokari ארבע-קו מובהק 1
## 9: Stenodactylus sthenodactylus ישימונית מצויה 1
We have either 15 (T0) or 12 (T3) individuals of Acanthodactylus scutellatus - does this make sense? What can we do about it if not?
reptiles[point_name == 'Ashdod Far Semi-Shifting 3' & campaign %in% c('T0', 'T3'), .(total.ind = sum(count_individuals)), keyby = .(survey_ID, campaign, Date, SciName, heb_name, age, sex_new, observation_type, material, activity, orientation, substrate)]
## survey_ID campaign Date
## 1: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 2: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 3: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 4: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 5: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 6: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 7: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 8: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 9: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 10: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 11: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## SciName heb_name age sex_new
## 1: Acanthodactylus scutellatus שנונית חולות subadult <NA>
## 2: Chalcides sepsoides נחושית חולות
## 3: Stenodactylus sthenodactylus ישימונית מצויה
## 4: Acanthodactylus scutellatus שנונית חולות adult <NA>
## 5: Acanthodactylus scutellatus שנונית חולות juvenile <NA>
## 6: Acanthodactylus scutellatus שנונית חולות juvenile <NA>
## 7: Chalcides ocellatus נחושית עינונית <NA> <NA>
## 8: Chalcides sepsoides נחושית חולות <NA> <NA>
## 9: Macroprotodon cucullatus נחש כיפה <NA> <NA>
## 10: Psammophis schokari ארבע-קו מובהק <NA> <NA>
## 11: Stenodactylus sthenodactylus ישימונית מצויה <NA> <NA>
## observation_type material activity orientation substrate total.ind
## 1: direct <NA> moving between <NA> 15
## 2: indirect tracks <NA> 1
## 3: indirect tracks <NA> 1
## 4: direct <NA> moving <NA> <NA> 1
## 5: direct <NA> moving <NA> <NA> 9
## 6: direct <NA> moving near shrub 2
## 7: indirect <NA> tracks <NA> <NA> 1
## 8: indirect <NA> tracks <NA> <NA> 1
## 9: indirect <NA> tracks <NA> <NA> 1
## 10: indirect <NA> tracks <NA> <NA> 1
## 11: indirect <NA> tracks <NA> <NA> 1
reptiles[point_name == 'Ashdod Far Semi-Shifting 3' & campaign %in% c('T0', 'T3'), .(survey_ID, campaign, Date, SciName, heb_name, count_individuals, age, sex_new, observation_type, material, activity, orientation, substrate)]
## survey_ID campaign Date
## 1: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 2: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 3: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 4: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 5: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 6: T0_Ashdod Far Semi-Shifting 3 T0 2014-09-30
## 7: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 8: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 9: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 10: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 11: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 12: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 13: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 14: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 15: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 16: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## 17: T3_Ashdod Far Semi-Shifting 3 T3 2019-08-25
## SciName heb_name count_individuals age
## 1: Acanthodactylus scutellatus שנונית חולות 3 subadult
## 2: Acanthodactylus scutellatus שנונית חולות 7 subadult
## 3: Acanthodactylus scutellatus שנונית חולות 1 subadult
## 4: Acanthodactylus scutellatus שנונית חולות 4 subadult
## 5: Chalcides sepsoides נחושית חולות 1
## 6: Stenodactylus sthenodactylus ישימונית מצויה 1
## 7: Acanthodactylus scutellatus שנונית חולות 1 juvenile
## 8: Acanthodactylus scutellatus שנונית חולות 1 juvenile
## 9: Acanthodactylus scutellatus שנונית חולות 1 adult
## 10: Acanthodactylus scutellatus שנונית חולות 2 juvenile
## 11: Acanthodactylus scutellatus שנונית חולות 3 juvenile
## 12: Acanthodactylus scutellatus שנונית חולות 4 juvenile
## 13: Chalcides ocellatus נחושית עינונית 1 <NA>
## 14: Chalcides sepsoides נחושית חולות 1 <NA>
## 15: Macroprotodon cucullatus נחש כיפה 1 <NA>
## 16: Psammophis schokari ארבע-קו מובהק 1 <NA>
## 17: Stenodactylus sthenodactylus ישימונית מצויה 1 <NA>
## sex_new observation_type material activity orientation substrate
## 1: <NA> direct <NA> moving between <NA>
## 2: <NA> direct <NA> moving between <NA>
## 3: <NA> direct <NA> moving between <NA>
## 4: <NA> direct <NA> moving between <NA>
## 5: indirect tracks <NA>
## 6: indirect tracks <NA>
## 7: <NA> direct <NA> moving <NA> <NA>
## 8: <NA> direct <NA> moving <NA> <NA>
## 9: <NA> direct <NA> moving <NA> <NA>
## 10: <NA> direct <NA> moving near shrub
## 11: <NA> direct <NA> moving <NA> <NA>
## 12: <NA> direct <NA> moving <NA> <NA>
## 13: <NA> indirect <NA> tracks <NA> <NA>
## 14: <NA> indirect <NA> tracks <NA> <NA>
## 15: <NA> indirect <NA> tracks <NA> <NA>
## 16: <NA> indirect <NA> tracks <NA> <NA>
## 17: <NA> indirect <NA> tracks <NA> <NA>
For the moment, we do not take any action and proceed with modelling abundance. Note that we do NOT include triple interactions in the full model but rather 3 combinations of double interactions. Model selection:
# Full model, Poisson response
coast.total.abnd.model.full.Poisson <- glmmTMB(total.abundance ~ year.count * settlements + year.count * dunes + dunes * settlements + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
summary(coast.total.abnd.model.full.Poisson) # All p-values, AIC and BIC are NAs
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count * settlements + year.count * dunes +
## dunes * settlements + sin.dist.21.June + cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 786.0 814.2 -384.0 768.0 161
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.015818 0.359149 2.828 0.00468 **
## year.count 0.003707 0.022634 0.164 0.86989
## settlementsNear -0.307547 0.137903 -2.230 0.02574 *
## dunesshifting -0.288655 0.135875 -2.124 0.03364 *
## sin.dist.21.June 0.708053 0.387315 1.828 0.06753 .
## cos.dist.21.June 0.747726 0.128890 5.801 6.58e-09 ***
## RegionSouth 0.233405 0.081562 2.862 0.00421 **
## year.count:settlementsNear 0.018881 0.031918 0.592 0.55415
## year.count:dunesshifting 0.041808 0.031018 1.348 0.17770
## settlementsNear:dunesshifting NA NA NA NA
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
deviance(coast.total.abnd.model.full.Poisson)/df.residual(coast.total.abnd.model.full.Poisson) #
## [1] 0.9715055
As the PHI (deviance divided by residual degrees of freedom) < 1, we proceed with Poisson models.
drop1(coast.total.abnd.model.full.Poisson)
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
## dropping columns from rank-deficient conditional model: settlementsNear:dunesshifting
## Single term deletions
##
## Model:
## total.abundance ~ year.count * settlements + year.count * dunes +
## dunes * settlements + sin.dist.21.June + cos.dist.21.June +
## Region
## Df AIC
## <none> 786.01
## sin.dist.21.June 1 787.43
## cos.dist.21.June 1 820.91
## Region 1 792.61
## year.count:settlements 1 784.36
## year.count:dunes 1 785.83
## settlements:dunes 0 786.01
# Omit dunes * settlements interaction, Poisson:
coast.total.abnd.model1 <- glmmTMB(total.abundance ~ year.count * settlements + year.count * dunes + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.total.abnd.model1)
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count * settlements + year.count * dunes +
## sin.dist.21.June + cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 786.0 814.2 -384.0 768.0 161
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.015818 0.359149 2.828 0.00468 **
## year.count 0.003707 0.022634 0.164 0.86989
## settlementsNear -0.307547 0.137903 -2.230 0.02574 *
## dunesshifting -0.288655 0.135875 -2.124 0.03364 *
## sin.dist.21.June 0.708053 0.387315 1.828 0.06753 .
## cos.dist.21.June 0.747726 0.128890 5.801 6.58e-09 ***
## RegionSouth 0.233405 0.081562 2.862 0.00421 **
## year.count:settlementsNear 0.018881 0.031918 0.592 0.55415
## year.count:dunesshifting 0.041808 0.031018 1.348 0.17770
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.total.abnd.model1)
## Single term deletions
##
## Model:
## total.abundance ~ year.count * settlements + year.count * dunes +
## sin.dist.21.June + cos.dist.21.June + Region
## Df AIC
## <none> 786.01
## sin.dist.21.June 1 787.43
## cos.dist.21.June 1 820.91
## Region 1 792.61
## year.count:settlements 1 784.36
## year.count:dunes 1 785.83
We can drop the interaction between trend and distance to settlements:
# Omit trend * settlements interaction, Poisson:
coast.total.abnd.model2 <- glmmTMB(total.abundance ~ settlements + year.count * dunes + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.total.abnd.model2)
## Family: poisson ( log )
## Formula:
## total.abundance ~ settlements + year.count * dunes + sin.dist.21.June +
## cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 784.4 809.4 -384.2 768.4 162
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.98898 0.35633 2.775 0.00551 **
## settlementsNear -0.23918 0.07492 -3.192 0.00141 **
## year.count 0.01214 0.01757 0.691 0.48968
## dunesshifting -0.25853 0.12641 -2.045 0.04084 *
## sin.dist.21.June 0.70366 0.38710 1.818 0.06910 .
## cos.dist.21.June 0.74591 0.12880 5.791 6.98e-09 ***
## RegionSouth 0.23414 0.08156 2.871 0.00409 **
## year.count:dunesshifting 0.03347 0.02763 1.212 0.22570
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.total.abnd.model2)
## Single term deletions
##
## Model:
## total.abundance ~ settlements + year.count * dunes + sin.dist.21.June +
## cos.dist.21.June + Region
## Df AIC
## <none> 784.36
## settlements 1 792.63
## sin.dist.21.June 1 785.74
## cos.dist.21.June 1 819.12
## Region 1 791.02
## year.count:dunes 1 783.83
We can drop the trend and dune type interaction:
# Omit trend * settlements interaction, Poisson:
coast.total.abnd.model3 <- glmmTMB(total.abundance ~ settlements + year.count + dunes + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.total.abnd.model3)
## Family: poisson ( log )
## Formula:
## total.abundance ~ settlements + year.count + dunes + sin.dist.21.June +
## cos.dist.21.June + Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 783.8 805.8 -384.9 769.8 163
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.95423 0.35507 2.687 0.00720 **
## settlementsNear -0.23875 0.07492 -3.187 0.00144 **
## year.count 0.02334 0.01492 1.564 0.11789
## dunesshifting -0.13412 0.07247 -1.851 0.06422 .
## sin.dist.21.June 0.69753 0.38683 1.803 0.07136 .
## cos.dist.21.June 0.74258 0.12868 5.771 7.9e-09 ***
## RegionSouth 0.23387 0.08155 2.868 0.00413 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.total.abnd.model3)
## Single term deletions
##
## Model:
## total.abundance ~ settlements + year.count + dunes + sin.dist.21.June +
## cos.dist.21.June + Region
## Df AIC
## <none> 783.83
## settlements 1 792.06
## year.count 1 784.26
## dunes 1 785.26
## sin.dist.21.June 1 785.15
## cos.dist.21.June 1 818.31
## Region 1 790.47
We can drop the trend altogether as delta AIC < 2:
# Omit trend * settlements interaction, Poisson:
coast.total.abnd.model4 <- glmmTMB(total.abundance ~ settlements + dunes + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.total.abnd.model4)
## Family: poisson ( log )
## Formula:
## total.abundance ~ settlements + dunes + sin.dist.21.June + cos.dist.21.June +
## Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 784.3 803.1 -386.1 772.3 164
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.76757 0.34039 2.255 0.02413 *
## settlementsNear -0.24007 0.07491 -3.205 0.00135 **
## dunesshifting -0.13550 0.07247 -1.870 0.06151 .
## sin.dist.21.June 0.98133 0.34622 2.834 0.00459 **
## cos.dist.21.June 0.84095 0.11415 7.367 1.75e-13 ***
## RegionSouth 0.23688 0.08167 2.900 0.00373 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.total.abnd.model4)
## Single term deletions
##
## Model:
## total.abundance ~ settlements + dunes + sin.dist.21.June + cos.dist.21.June +
## Region
## Df AIC
## <none> 784.26
## settlements 1 792.61
## dunes 1 785.76
## sin.dist.21.June 1 790.48
## cos.dist.21.June 1 841.55
## Region 1 791.09
We can drop the dune type as well and still have delta AIC < 2 from model 3 (that has the minimum AIC so far):
# Omit trend * settlements interaction, Poisson:
coast.total.abnd.model5 <- glmmTMB(total.abundance ~ settlements + sin.dist.21.June + cos.dist.21.June + Region, family = 'poisson', data = coast)
summary(coast.total.abnd.model5)
## Family: poisson ( log )
## Formula:
## total.abundance ~ settlements + sin.dist.21.June + cos.dist.21.June +
## Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 785.8 801.4 -387.9 775.8 165
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.71033 0.33910 2.095 0.03619 *
## settlementsNear -0.17437 0.06680 -2.610 0.00905 **
## sin.dist.21.June 0.97221 0.34610 2.809 0.00497 **
## cos.dist.21.June 0.83798 0.11415 7.341 2.12e-13 ***
## RegionSouth 0.23708 0.08168 2.903 0.00370 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(coast.total.abnd.model5)
## Single term deletions
##
## Model:
## total.abundance ~ settlements + sin.dist.21.June + cos.dist.21.June +
## Region
## Df AIC
## <none> 785.76
## settlements 1 790.73
## sin.dist.21.June 1 791.83
## cos.dist.21.June 1 842.63
## Region 1 792.61
Now we can no longer drop predictors with increasing AIC by more than 2 points compared to its minimum level so far, so we choose model 5 for abundance. We should now test the selected model via diagnostic plots:
coast.abnd.sim.res <- simulateResiduals(coast.total.abnd.model5) # simulate the residuals using DHARMa package for model diagnostics
plot(coast.abnd.sim.res) # No significant problems detected
plot(coast.abnd.sim.res$fittedPredictedResponse, coast.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nCoastal Plain abundance model 5')
plot(fitted(coast.total.abnd.model5), residuals(coast.total.abnd.model5), main = 'Response scale residuals\nCoastal Plain abundance model 5')
# Export these graphs:
png('Analysis/Model diagnostics/Coastal Plain abundance model 5 QQ Plot.png')
plot(coast.abnd.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Coastal Plain abundance model 5 - DHARMa predicted response vs scaled residuals.png')
plot(coast.abnd.sim.res$fittedPredictedResponse, coast.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nCoastl Plain abundance model 5')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Coastal Plain abundance model 5 - fitted values vs residuals.png')
plot(fitted(coast.total.abnd.model5), residuals(coast.total.abnd.model5), main = 'Response scale residuals\nCoastal Plain abundance')
dev.off()
## png
## 2
# Plot the scaled residuals vs. fitted (predicted) response - no pattern here
There are no clear patterns/issues with the model fit. Back up all models, create a table comparing their AIC and BIC scores and keep only the selected model:
file.remove('Analysis/Coastal Dunes - total abundance model selection.txt')
## [1] TRUE
for (model in c(ls()[grep('*coast.total.abnd.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/Coastal Dunes - total abundance model selection.txt', append = T)
}
# load('Analysis/Coast Dunes - total abundance models.Rdata')
save(list = ls()[grep('*coast.total.abnd.model', ls())], file = 'Analysis/Coast Dunes - total abundance models.Rdata')
capture.output(cat('The best fitting model for species richness in the Coastal Dunes is coast.total.abnd.model5.'),
summary(coast.total.abnd.model5),
testDispersion(coast.abnd.sim.res, alternative = 'less', plot = F),
testDispersion(coast.abnd.sim.res, alternative = 'greater', plot = F),
testZeroInflation(coast.abnd.sim.res, alternative = 'greater', plot = F),
testZeroInflation(coast.abnd.sim.res, alternative = 'less', plot = F),
file = 'Output/Coastal Dunes total abundance - best fitting model.txt', append = F)
# Create a table comparing total abundance models:
total.abnd.comparison <- data.table(unit = '', model = '', data = '', family = '', formula = '', no.of.preds = 0, AIC = 0, BIC = 0) # Create a data.table to be filled by a loop
total.abnd.comparison <- total.abnd.comparison[AIC > 0] # empty the data.table
for(model in ls()[grep('*coast.total.abnd.model.', ls())]){
total.abnd.comparison <- rbind(total.abnd.comparison,
data.table(unit = 'Coast Sands', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
total.abnd.comparison <- total.abnd.comparison[!(formula %like% '~' | formula %like% 'total.abundance')] # remove redundant rows
total.abnd.comparison <- unique(total.abnd.comparison)
setorder(total.abnd.comparison, unit, AIC) # Sort by AIC (ascending)
total.abnd.comparison[unit == 'Coast Sands'] # View the table
## unit model data family
## 1: Coast Sands coast.total.abnd.model3 coast poisson
## 2: Coast Sands coast.total.abnd.model4 coast poisson
## 3: Coast Sands coast.total.abnd.model2 coast poisson
## 4: Coast Sands coast.total.abnd.model5 coast poisson
## 5: Coast Sands coast.total.abnd.model.full.Poisson coast poisson
## 6: Coast Sands coast.total.abnd.model1 coast poisson
## formula
## 1: settlements + year.count + dunes + sin.dist.21.June + cos.dist.21.June + Region
## 2: settlements + dunes + sin.dist.21.June + cos.dist.21.June + Region
## 3: settlements + year.count * dunes + sin.dist.21.June + cos.dist.21.June + Region
## 4: settlements + sin.dist.21.June + cos.dist.21.June + Region
## 5: year.count * settlements + year.count * dunes + dunes * settlements + sin.dist.21.June + cos.dist.21.June + Region
## 6: year.count * settlements + year.count * dunes + sin.dist.21.June + cos.dist.21.June + Region
## no.of.preds AIC BIC
## 1: 6 783.8312 805.7818
## 2: 5 784.2577 803.0725
## 3: 7 784.3607 809.4471
## 4: 4 785.7615 801.4404
## 5: 9 786.0107 814.2329
## 6: 8 786.0107 814.2329
write_excel_csv(total.abnd.comparison, file = 'Analysis/Coastal Dunes total abundance models of reptiles - AIC comparison.csv')
rm(list = setdiff(ls()[grep('*coast.total.abnd.model', ls())], c('coast.total.abnd.model5'))) # Clean up
Since the chosen model includes a difference between near and far plots, we will try to predict its magnitude (without extrapolating):
# Coastal Sands - predict reptile total abundance----
summary(coast.total.abnd.model5)
## Family: poisson ( log )
## Formula:
## total.abundance ~ settlements + sin.dist.21.June + cos.dist.21.June +
## Region
## Data: coast
##
## AIC BIC logLik deviance df.resid
## 785.8 801.4 -387.9 775.8 165
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.71033 0.33910 2.095 0.03619 *
## settlementsNear -0.17437 0.06680 -2.610 0.00905 **
## sin.dist.21.June 0.97221 0.34610 2.809 0.00497 **
## cos.dist.21.June 0.83798 0.11415 7.341 2.12e-13 ***
## RegionSouth 0.23708 0.08168 2.903 0.00370 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Predict by the mean observed values
reptiles[, sort(unique(unit))]
## [1] Coastal Plain Sands
## [2] Inland Sands
## [3] Loess Covered Areas in the Northern Negev
## [4] Mediterranean-Desert Transition Zone
## [5] Planted Conifer Forests
## 5 Levels: Coastal Plain Sands ... Planted Conifer Forests
quantile(reptiles[unit == 'Coastal Plain Sands', .(day.of.year = unique(yday(date))), by = survey_ID][, day.of.year])
## 0% 25% 50% 75% 100%
## 202 232 263 293 293
# Dates vary from 202 (July 21st) to 293 (October 20th) with a median of 263 (September 20th)
quantile(reptiles[unit == 'Coastal Plain Sands', .(Time = unique(ITime)), by = survey_ID][, Time])
## [1] "05:40:00" "08:25:15" "15:56:30" "17:20:45" "19:40:00"
# Hours vary from 05:40 to 19:40, with a median of 13:49:30
## Calculate the mean radian angle of the date and time of sampling and use this for model fit to predict trends
# Create a table to be filled by a loop with predictor values to be used for predictions
reptiles[unit %like% 'Coast', .(no.of.surveys = uniqueN(survey_ID)), keyby = yday(Date)] # day 279 is the most common date
## yday no.of.surveys
## 1: 205 9
## 2: 215 9
## 3: 218 9
## 4: 225 9
## 5: 231 9
## 6: 237 9
## 7: 241 9
## 8: 252 8
## 9: 253 9
## 10: 259 6
## 11: 265 9
## 12: 269 9
## 13: 271 6
## 14: 273 6
## 15: 274 4
## 16: 275 2
## 17: 278 7
## 18: 279 14
## 19: 286 6
## 20: 287 3
## 21: 288 9
## 22: 296 9
## yday no.of.surveys
yday(as.Date('2021-10-06')) # October 6th is day 279 in non-leap years
## [1] 279
reptiles[unit %like% 'Coast', .(no.of.surveys = uniqueN(survey_ID)), keyby = month(Date)] # August to October are equally the most common months
## month no.of.surveys
## 1: 7 9
## 2: 8 54
## 3: 9 53
## 4: 10 54
reptiles[unit %like% 'Coast', .(no.of.surveys = uniqueN(survey_ID)), keyby = round(ITime)] # 16:00 to 18:00 is the most common hours
## round no.of.surveys
## 1: 06:00:00 13
## 2: 07:00:00 19
## 3: 08:00:00 12
## 4: 09:00:00 7
## 5: 10:00:00 10
## 6: 11:00:00 2
## 7: 14:00:00 1
## 8: 15:00:00 10
## 9: 16:00:00 28
## 10: 17:00:00 29
## 11: 18:00:00 27
## 12: 19:00:00 11
## 13: 20:00:00 1
plot(reptiles[unit %like% 'Coast', sort(ITime)])
hist(reptiles[unit %like% 'Coast', ITime])
reptiles[unit %like% 'Coast', .(no.of.surveys = uniqueN(survey_ID)), keyby = ITime] # this indeed seems to be the case...
## ITime no.of.surveys
## 1: 05:40:00 1
## 2: 05:45:00 1
## 3: 05:48:00 1
## 4: 06:00:00 1
## 5: 06:01:00 1
## ---
## 147: 18:52:00 1
## 148: 19:06:00 1
## 149: 19:10:00 1
## 150: 19:18:00 1
## 151: 19:40:00 1
# Plot the model seasonal pattern
reptiles[unit %like% 'Coast', unique(year)]
## [1] 2014 2015 2017 2019 2021
coast.total.abnd.sea <- data.table(expand.grid(Date = seq.Date(as.Date('2014-01-01'), as.Date('2021-12-31'), by = 1), settlements = coast[, unique(settlements)], Region = c('North', 'South')))
coast.total.abnd.sea[, ':=' (year = year(Date),
dist.21.June = ifelse(yday(Date) < 354,
Date - as.Date(paste(year(Date), 6, 21, sep = '-')),
Date - as.Date(paste(year(Date) + 1, 6, 21, sep = '-'))))]
coast.total.abnd.sea <- coast.total.abnd.sea[year %in% reptiles[unit %like% 'Coast', unique(year)]]
coast.total.abnd.sea[, ':=' (dist.21.June.radians = dist.21.June * pi / 182.5, # Convert to radians (multiply by pi and divide by half the number of days in a year), one harmonic
dist.21.June.radians.2h = 2*dist.21.June * pi / 182.5)]
setorder(coast.total.abnd.sea, Date, dist.21.June.radians)
coast.total.abnd.sea[, ':=' (year.count = year - min(year))]
coast.total.abnd.sea[, ':=' (sin.dist.21.June = sin(dist.21.June.radians), cos.dist.21.June = cos(dist.21.June.radians))] # Calculate the sin and cosine of the distance from June 21st
coast.total.abnd.sea
## Date settlements Region year dist.21.June dist.21.June.radians
## 1: 2014-01-01 Far North 2014 -171 -2.943629
## 2: 2014-01-01 Near North 2014 -171 -2.943629
## 3: 2014-01-01 Far South 2014 -171 -2.943629
## 4: 2014-01-01 Near South 2014 -171 -2.943629
## 5: 2014-01-02 Far North 2014 -170 -2.926415
## ---
## 7296: 2021-12-30 Near South 2021 -173 -2.978058
## 7297: 2021-12-31 Far North 2021 -172 -2.960843
## 7298: 2021-12-31 Near North 2021 -172 -2.960843
## 7299: 2021-12-31 Far South 2021 -172 -2.960843
## 7300: 2021-12-31 Near South 2021 -172 -2.960843
## dist.21.June.radians.2h year.count sin.dist.21.June cos.dist.21.June
## 1: -5.887259 0 -0.1966729 -0.9804692
## 2: -5.887259 0 -0.1966729 -0.9804692
## 3: -5.887259 0 -0.1966729 -0.9804692
## 4: -5.887259 0 -0.1966729 -0.9804692
## 5: -5.852830 0 -0.2135209 -0.9769385
## ---
## 7296: -5.956115 7 -0.1628070 -0.9866579
## 7297: -5.921687 7 -0.1797666 -0.9837093
## 7298: -5.921687 7 -0.1797666 -0.9837093
## 7299: -5.921687 7 -0.1797666 -0.9837093
## 7300: -5.921687 7 -0.1797666 -0.9837093
plot(coast.total.abnd.sea[year == 2017, Date], coast.total.abnd.sea[year == 2017,sin.dist.21.June],
main = 'Sine of distance to June 21st') # sanity check - should be a wave
plot(coast.total.abnd.sea[year == 2017, Date], coast.total.abnd.sea[year == 2017,cos.dist.21.June],
main = 'Cosine of distance to June 21st') # sanity check - should be a wave
bla <- predict(coast.total.abnd.model5, newdata = coast.total.abnd.sea, type = 'response', se.fit = T)
coast.total.abnd.sea[, ':=' (predicted.abnd = bla$fit, predicted.abnd.se = bla$se.fit)]
coast.total.abnd.sea[month(Date) %in% 9, .(mean.predicted.abnd = mean(predicted.abnd)), keyby = .(year)]
## year mean.predicted.abnd
## 1: 2014 5.957572
## 2: 2015 5.957572
## 3: 2017 5.957572
## 4: 2019 5.957572
## 5: 2021 5.957572
coast.total.abnd.sea
## Date settlements Region year dist.21.June dist.21.June.radians
## 1: 2014-01-01 Far North 2014 -171 -2.943629
## 2: 2014-01-01 Near North 2014 -171 -2.943629
## 3: 2014-01-01 Far South 2014 -171 -2.943629
## 4: 2014-01-01 Near South 2014 -171 -2.943629
## 5: 2014-01-02 Far North 2014 -170 -2.926415
## ---
## 7296: 2021-12-30 Near South 2021 -173 -2.978058
## 7297: 2021-12-31 Far North 2021 -172 -2.960843
## 7298: 2021-12-31 Near North 2021 -172 -2.960843
## 7299: 2021-12-31 Far South 2021 -172 -2.960843
## 7300: 2021-12-31 Near South 2021 -172 -2.960843
## dist.21.June.radians.2h year.count sin.dist.21.June cos.dist.21.June
## 1: -5.887259 0 -0.1966729 -0.9804692
## 2: -5.887259 0 -0.1966729 -0.9804692
## 3: -5.887259 0 -0.1966729 -0.9804692
## 4: -5.887259 0 -0.1966729 -0.9804692
## 5: -5.852830 0 -0.2135209 -0.9769385
## ---
## 7296: -5.956115 7 -0.1628070 -0.9866579
## 7297: -5.921687 7 -0.1797666 -0.9837093
## 7298: -5.921687 7 -0.1797666 -0.9837093
## 7299: -5.921687 7 -0.1797666 -0.9837093
## 7300: -5.921687 7 -0.1797666 -0.9837093
## predicted.abnd predicted.abnd.se
## 1: 0.7389687 0.3672888
## 2: 0.6207225 0.3096791
## 3: 0.9366757 0.4525473
## 4: 0.7867934 0.3815641
## 5: 0.7291171 0.3662792
## ---
## 7296: 0.8089236 0.3835488
## 7297: 0.7491782 0.3683366
## 7298: 0.6292983 0.3105891
## 7299: 0.9496168 0.4536645
## 7300: 0.7976637 0.3825398
# plot the seasonal predictions
ggplot(data = coast.total.abnd.sea, aes(x = as.Date(paste(2017, month(Date), mday(Date), sep = '-')), y = predicted.abnd, color = settlements, linetype = Region, shape = Region)) + geom_line() +
geom_point(data = reptiles[unit %like% 'Coast', .(total.abnd = sum(count_individuals, na.rm = T)),
keyby = .(Region = ifelse(site == 'Caesarea', 'North', 'South'), settlements, survey_ID, year(Date), as.Date(paste(2017, month(Date), mday(Date), sep = '-')))],
aes(x = as.Date, y = total.abnd)) + labs(x = 'Date', y = 'Abundance', title = 'Coastal Sands Reptiles',
subtitle = 'Predicted and observed abundance') +
facet_wrap(. ~ year) + scale_x_date(date_labels = '%b')
ggsave('Analysis/coast.total.abnd.model5 seasonal Predictions and observations in reptile total abundance in the Coastal Sand Dunes.png')
## Saving 7 x 5 in image
# Create a data.table for predictions
coast.total.abnd.fit.data <- data.table(expand.grid(Date = as.Date('2017-08-15'), settlements = c('Far', 'Near'), Region = c('North','South')))
coast.total.abnd.fit.data[, ':=' (dist.21.June = ifelse(yday(Date) < 354,
Date - as.Date(paste(year(Date), 6, 21, sep = '-')),
Date - as.Date(paste(year(Date) + 1, 6, 21, sep = '-'))))]
coast.total.abnd.fit.data[, ':=' (dist.21.June.radians = dist.21.June * pi / 182.5, # Convert to radians (multiply by pi and divide by half the number of days in a year), one harmonic
dist.21.June.radians.2h = 2*dist.21.June * pi / 182.5)]
setorder(coast.total.abnd.fit.data, dist.21.June.radians)
coast.total.abnd.fit.data # seems ok
## Date settlements Region dist.21.June dist.21.June.radians
## 1: 2017-08-15 Far North 55 0.9467813
## 2: 2017-08-15 Near North 55 0.9467813
## 3: 2017-08-15 Far South 55 0.9467813
## 4: 2017-08-15 Near South 55 0.9467813
## dist.21.June.radians.2h
## 1: 1.893563
## 2: 1.893563
## 3: 1.893563
## 4: 1.893563
coast.total.abnd.fit.data[, ':=' (sin.dist.21.June = sin(dist.21.June.radians), cos.dist.21.June = cos(dist.21.June.radians))] # Calculate the sin and cosine of the distance from June 21st
coast.total.abnd.fit.data
## Date settlements Region dist.21.June dist.21.June.radians
## 1: 2017-08-15 Far North 55 0.9467813
## 2: 2017-08-15 Near North 55 0.9467813
## 3: 2017-08-15 Far South 55 0.9467813
## 4: 2017-08-15 Near South 55 0.9467813
## dist.21.June.radians.2h sin.dist.21.June cos.dist.21.June
## 1: 1.893563 0.8115391 0.5842982
## 2: 1.893563 0.8115391 0.5842982
## 3: 1.893563 0.8115391 0.5842982
## 4: 1.893563 0.8115391 0.5842982
bla <- predict(coast.total.abnd.model5, newdata = coast.total.abnd.fit.data, type = 'response', se.fit = T)
coast.total.abnd.fit.data[, ':=' (predicted.abnd = bla$fit, predicted.abnd.se = bla$se.fit)]
coast.total.abnd.fit.data[, .(settlements, predicted.abnd, predicted.abnd.se)] #
## settlements predicted.abnd predicted.abnd.se
## 1: Far 7.307843 0.5965563
## 2: Near 6.138477 0.5688499
## 3: Far 9.263016 0.4454478
## 4: Near 7.780793 0.5001950
coast.total.abnd.fit.data # Now the predictions finally make sense!
## Date settlements Region dist.21.June dist.21.June.radians
## 1: 2017-08-15 Far North 55 0.9467813
## 2: 2017-08-15 Near North 55 0.9467813
## 3: 2017-08-15 Far South 55 0.9467813
## 4: 2017-08-15 Near South 55 0.9467813
## dist.21.June.radians.2h sin.dist.21.June cos.dist.21.June predicted.abnd
## 1: 1.893563 0.8115391 0.5842982 7.307843
## 2: 1.893563 0.8115391 0.5842982 6.138477
## 3: 1.893563 0.8115391 0.5842982 9.263016
## 4: 1.893563 0.8115391 0.5842982 7.780793
## predicted.abnd.se
## 1: 0.5965563
## 2: 0.5688499
## 3: 0.4454478
## 4: 0.5001950
write_excel_csv(coast.total.abnd.fit.data, 'Output/Reptile predicted total abundance in the Coastal Sands model7.csv')
coast.total.abnd.pred <- melt(unique(coast.total.abnd.fit.data[, .(settlements, Region, predicted.abnd)]),
id.vars = c('settlements', 'Region'), variable.name = 'quality', value.name = 'predicted.abnd')
setorder(coast.total.abnd.pred, settlements, Region)
coast.total.abnd.pred # seems ok
## settlements Region quality predicted.abnd
## 1: Far North predicted.abnd 7.307843
## 2: Far South predicted.abnd 9.263016
## 3: Near North predicted.abnd 6.138477
## 4: Near South predicted.abnd 7.780793
write_excel_csv(coast.total.abnd.pred, file = 'Output/Coastal sands - predictions of total reptile abundance.csv')
Calculate the mean abundance in Near and Far plots, and calculate the percent difference between the rounded values:
coast.total.abnd.pred[, .(mean.pred.abnd = round(mean(predicted.abnd), 1)), keyby = settlements]
## settlements mean.pred.abnd
## 1: Far 8.3
## 2: Near 7.0
coast.total.abnd.pred[, .(mean.pred.abnd = round(mean(predicted.abnd), 1)), keyby = settlements][, max(mean.pred.abnd)] / coast.total.abnd.pred[, .(mean.pred.abnd = round(mean(predicted.abnd), 1)), keyby = settlements][, min(mean.pred.abnd)] - 1
## [1] 0.1857143
Hence, the mean predicted abundance is 8.3 reptiles in the Far plots compared to 7.0 reptiles in the Near plots (18.6% difference).
# Effect plot of annual trend
coast.abnd.trend.plot <- effect_plot(model = coast.total.abnd.model5, pred = settlements, data = coast, colors = "Qual1",point.size = 4,
line.colors = 'black', point.alpha = 0.25, interval = T, plot.points = T, partial.residuals = F,
jitter = c(0.1,0), int.type = 'confidence') +
theme_minimal() + labs(y = strReverse('שפע כולל'), x = strReverse('קרבה לישובים')) +
scale_x_discrete(labels = c(strReverse('רחוק'),
strReverse('קרוב'))) +
theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom',
text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major.y = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.major.x = element_blank(), panel.grid.minor.x = element_blank())
## Warning in check_dots(..., .action = "warning"): unknown arguments: interval
coast.abnd.trend.plot$layers[[2]]$geom_params$width <- 0.4
coast.abnd.trend.plot
Cairo::Cairo(file = 'Figures/Coastal Plain total abundance model5 effect plot - temporal trend.pdf', width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(coast.abnd.trend.plot)
dev.off()
## png
## 2
Next unit: the inland sands. Some exploration first:
reptiles[unit %like% 'Inland' & !is.na(SciName), .(total.abnd = sum(count_individuals), total.sp.rich = uniqueN(SciName))] # 594 reptiles from 17 species
## total.abnd total.sp.rich
## 1: 594 17
alpha.div[, sort(unique(unit))]
## [1] Coastal Plain Sands
## [2] Inland Sands
## [3] Loess Covered Areas in the Northern Negev
## [4] Mediterranean-Desert Transition Zone
## [5] Planted Conifer Forests
## 5 Levels: Coastal Plain Sands ... Planted Conifer Forests
inland.sands <- alpha.div[unit == 'Inland Sands'] # subset the inland sands
str(inland.sands)
## Classes 'data.table' and 'data.frame': 72 obs. of 23 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 2 2 2 2 2 2 2 2 2 2 ...
## $ year : num 2017 2017 2017 2017 2017 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 6 6 6 6 6 6 6 6 6 6 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 36 37 38 39 40 41 43 44 45 46 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 296 297 298 299 300 301 302 303 304 305 ...
## $ Date : Date, format: "2017-06-14" "2017-06-26" ...
## $ sin.dist.21.June : num -0.12 0.086 0.086 0.086 0.086 ...
## $ cos.dist.21.June : num 0.993 0.996 0.996 0.996 0.996 ...
## $ sin.dist.noon : num -0.903 -0.981 -0.906 -0.95 -0.989 ...
## $ cos.dist.noon : num 0.431 -0.195 0.423 0.313 -0.148 ...
## $ settlements : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ agriculture : Factor w/ 2 levels "Far","Near": 1 1 1 1 1 1 2 2 2 2 ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: 1 1 1 2 2 2 1 1 1 2 ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num 34.5 34.4 34.4 34.4 34.4 ...
## $ mean.lat : num 30.9 31 30.9 30.9 31 ...
## $ species.richness : num 4 6 6 7 6 5 8 3 6 5 ...
## $ total.abundance : num 10 6 15 12 10 6 8 8 10 6 ...
## $ geom.mean.abundance: num 1.63 1 1.78 1.47 1.52 ...
## $ year.count : num 0 0 0 0 0 0 0 0 0 0 ...
## $ year.fct : Factor w/ 8 levels "2014","2015",..: 3 3 3 3 3 3 3 3 3 3 ...
## - attr(*, "sorted")= chr "unit"
## - attr(*, ".internal.selfref")=<externalptr>
inland.sands[is.na(agriculture) | is.na(dunes)] # no missing variables
## Empty data.table (0 rows and 23 cols): unit,year,campaign,subunit,site,point_name...
inland.sands[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(campaign, year, site, agriculture, dunes)] # Always 3 surveys per site-agri-dunes
## campaign year site agriculture dunes no.of.surveys
## 1: T2 2017 Beer Milka Far semi-shifting 3
## 2: T2 2017 Beer Milka Far shifting 3
## 3: T2 2017 Beer Milka Near semi-shifting 3
## 4: T2 2017 Beer Milka Near shifting 3
## 5: T2 2017 Secher Far semi-shifting 3
## 6: T2 2017 Secher Far shifting 3
## 7: T2 2017 Shunra East Far semi-shifting 3
## 8: T2 2017 Shunra East Far shifting 3
## 9: T3 2019 Beer Milka Far semi-shifting 3
## 10: T3 2019 Beer Milka Far shifting 3
## 11: T3 2019 Beer Milka Near semi-shifting 3
## 12: T3 2019 Beer Milka Near shifting 3
## 13: T3 2019 Secher Far semi-shifting 3
## 14: T3 2019 Secher Far shifting 3
## 15: T3 2019 Shunra East Far semi-shifting 3
## 16: T3 2019 Shunra East Far shifting 3
## 17: T4 2021 Beer Milka Far semi-shifting 3
## 18: T4 2021 Beer Milka Far shifting 3
## 19: T4 2021 Beer Milka Near semi-shifting 3
## 20: T4 2021 Beer Milka Near shifting 3
## 21: T4 2021 Secher Far semi-shifting 3
## 22: T4 2021 Secher Far shifting 3
## 23: T4 2021 Shunra East Far semi-shifting 3
## 24: T4 2021 Shunra East Far shifting 3
## campaign year site agriculture dunes no.of.surveys
# Dot plots
Inner.sands.sp.rich.dotplot <- ggplot(data = inland.sands, aes(x = species.richness, y = site)) +
geom_point(aes(color = dunes, shape = agriculture)) + geom_line(aes(group = site)) +
facet_grid(campaign ~ .) + labs(title = 'Reptile Species Richness in the Inner Sands', y = 'Site', x = 'Species Richness', color = 'Dune Type',
shape = 'Proximity to agriculture') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, inland.sands[, max(species.richness) + 1]),
breaks = seq(0, inland.sands[, max(species.richness) + 1], by = 2)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
Inner.sands.sp.rich.dotplot
ggsave('Figures/Reptile species richness in the Inner sands - dotplot.png', plot = Inner.sands.sp.rich.dotplot)
## Saving 7 x 5 in image
Inner.sands.abnd.dotplot <- ggplot(data = inland.sands, aes(x = total.abundance, y = site)) +
geom_point(aes(color = dunes, shape = agriculture)) + geom_line(aes(group = site)) +
facet_grid(campaign ~ .) + labs(title = 'Reptile Total Abundance in the Inner Sands', y = 'Site', x = 'Total Abundance', color = 'Dune Type',
shape = 'Proximity to agriculture') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, inland.sands[, max(total.abundance) + 1]),
breaks = seq(0, inland.sands[, max(total.abundance) + 1], by = 2)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
Inner.sands.abnd.dotplot
ggsave('Figures/Reptile Total Abundance in the Inner sands - dotplot.png', plot = Inner.sands.abnd.dotplot)
## Saving 7 x 5 in image
Next, species richness. Start with data visualization:
# Inland sands species richness----
# The relevant predictors are distance to settlement, dunes, and temporal trend
# Plot species richness
ggplot(data = inland.sands, aes(x = dunes, color = agriculture, y = species.richness)) + geom_boxplot() +
geom_jitter(height = 0, width = 0.3) + facet_wrap(. ~ year) + theme_bw() # 2021 seem worse than 2017-2019
Species richness model selection:
## Inland sands species richness model selection----
# Full model, Poisson response
inland.sands.sp.rich.model.full.Poisson <- glmmTMB(species.richness ~ agriculture * dunes + sin.dist.21.June + cos.dist.21.June + site,
family = 'poisson', data = inland.sands)
summary(inland.sands.sp.rich.model.full.Poisson) # AIC = 296.8; BIC = 317.3. Only cosine seasonality is significant
## Family: poisson ( log )
## Formula:
## species.richness ~ agriculture * dunes + sin.dist.21.June + cos.dist.21.June +
## site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 295.6 313.8 -139.8 279.6 64
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.23149 1.00393 -0.231 0.8176
## agricultureNear -0.09090 0.18062 -0.503 0.6148
## dunesshifting -0.04027 0.11588 -0.348 0.7282
## sin.dist.21.June 0.61937 0.42424 1.460 0.1443
## cos.dist.21.June 2.02175 0.96692 2.091 0.0365 *
## siteSecher -0.00733 0.15070 -0.049 0.9612
## siteShunra East -0.09392 0.14153 -0.664 0.5069
## agricultureNear:dunesshifting 0.18502 0.22731 0.814 0.4157
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat('PHI = ')
## PHI =
deviance(inland.sands.sp.rich.model.full.Poisson)/df.residual(inland.sands.sp.rich.model.full.Poisson)
## [1] 0.3671671
drop1(inland.sands.sp.rich.model.full.Poisson) # Should omit sine distance to noon
## Single term deletions
##
## Model:
## species.richness ~ agriculture * dunes + sin.dist.21.June + cos.dist.21.June +
## site
## Df AIC
## <none> 295.60
## sin.dist.21.June 1 295.77
## cos.dist.21.June 1 298.09
## site 2 292.09
## agriculture:dunes 1 294.26
PHI < 1, so we continue with Poisson. We can drop the interaction between agriculture and dunes:
inland.sands.sp.rich.model1 <- glmmTMB(species.richness ~ agriculture + dunes + sin.dist.21.June + cos.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.sp.rich.model1)
## Family: poisson ( log )
## Formula:
## species.richness ~ agriculture + dunes + sin.dist.21.June + cos.dist.21.June +
## site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 294.3 310.2 -140.1 280.3 65
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.160308 1.002960 -0.160 0.873
## agricultureNear 0.001854 0.138098 0.013 0.989
## dunesshifting 0.007849 0.099661 0.079 0.937
## sin.dist.21.June 0.576815 0.421979 1.367 0.172
## cos.dist.21.June 1.931970 0.963553 2.005 0.045 *
## siteSecher -0.009585 0.150761 -0.064 0.949
## siteShunra East -0.093688 0.141552 -0.662 0.508
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.sp.rich.model1)
## Single term deletions
##
## Model:
## species.richness ~ agriculture + dunes + sin.dist.21.June + cos.dist.21.June +
## site
## Df AIC
## <none> 294.26
## agriculture 1 292.26
## dunes 1 292.26
## sin.dist.21.June 1 294.17
## cos.dist.21.June 1 296.40
## site 2 290.75
We can drop either agriculture or dune. Let’s try dropping dunes:
inland.sands.sp.rich.model2 <- glmmTMB(species.richness ~ agriculture + sin.dist.21.June + cos.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.sp.rich.model2)
## Family: poisson ( log )
## Formula:
## species.richness ~ agriculture + sin.dist.21.June + cos.dist.21.June +
## site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 292.3 305.9 -140.1 280.3 66
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.150885 0.995932 -0.152 0.8796
## agricultureNear 0.001735 0.138089 0.013 0.9900
## sin.dist.21.June 0.574359 0.420877 1.365 0.1724
## cos.dist.21.June 1.926782 0.961459 2.004 0.0451 *
## siteSecher -0.009715 0.150757 -0.064 0.9486
## siteShunra East -0.093673 0.141553 -0.662 0.5081
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.sp.rich.model2)
## Single term deletions
##
## Model:
## species.richness ~ agriculture + sin.dist.21.June + cos.dist.21.June +
## site
## Df AIC
## <none> 292.26
## agriculture 1 290.26
## sin.dist.21.June 1 292.17
## cos.dist.21.June 1 294.41
## site 2 288.75
Now let’s drop agriculture too:
inland.sands.sp.rich.model3 <- glmmTMB(species.richness ~ sin.dist.21.June + cos.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.sp.rich.model3)
## Family: poisson ( log )
## Formula: species.richness ~ sin.dist.21.June + cos.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 290.3 301.6 -140.1 280.3 67
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.15006 0.99381 -0.151 0.880
## sin.dist.21.June 0.57416 0.42059 1.365 0.172
## cos.dist.21.June 1.92691 0.96142 2.004 0.045 *
## siteSecher -0.01054 0.13588 -0.078 0.938
## siteShunra East -0.09457 0.12240 -0.773 0.440
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.sp.rich.model3)
## Single term deletions
##
## Model:
## species.richness ~ sin.dist.21.June + cos.dist.21.June + site
## Df AIC
## <none> 290.26
## sin.dist.21.June 1 290.17
## cos.dist.21.June 1 292.41
## site 2 286.88
We can drop sine seasonality:
inland.sands.sp.rich.model4 <- glmmTMB(species.richness ~ cos.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.sp.rich.model4)
## Family: poisson ( log )
## Formula: species.richness ~ cos.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 290.2 299.3 -141.1 282.2 68
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.08590 0.40130 2.706 0.00681 **
## cos.dist.21.June 0.76014 0.43529 1.746 0.08076 .
## siteSecher -0.03062 0.13581 -0.225 0.82163
## siteShunra East -0.08936 0.12242 -0.730 0.46543
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.sp.rich.model4)
## Single term deletions
##
## Model:
## species.richness ~ cos.dist.21.June + site
## Df AIC
## <none> 290.17
## cos.dist.21.June 1 291.27
## site 2 286.71
We can drop also cosine seasonality and retain only site ID (because we insist on keeping it despite indications from AIC that we should drop it):
inland.sands.sp.rich.model5 <- glmmTMB(species.richness ~ site, family = 'poisson', data = inland.sands)
summary(inland.sands.sp.rich.model5)
## Family: poisson ( log )
## Formula: species.richness ~ site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 291.3 298.1 -142.6 285.3 69
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.77307 0.06868 25.816 <2e-16 ***
## siteSecher -0.13084 0.12438 -1.052 0.293
## siteShunra East -0.05827 0.12131 -0.480 0.631
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.sp.rich.model5)
## Single term deletions
##
## Model:
## species.richness ~ site
## Df AIC
## <none> 291.27
## site 2 288.42
As we refuse to drop site identity, we cannot drop any more predictors. Let’s proceed to model diagnostics:
# Inland sands species richness model diagnostics and back up----
inland.sands.sp.rich.sim.res <- simulateResiduals(inland.sands.sp.rich.model5) # simulate the residuals using DHARMa package for model diagnostics
plot(inland.sands.sp.rich.sim.res) # Dispersion test is significant
testDispersion(inland.sands.sp.rich.sim.res, alternative = 'greater') # p = 1, suggesting under-dispersion
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.40226, p-value = 1
## alternative hypothesis: greater
testDispersion(inland.sands.sp.rich.sim.res, alternative = 'less', plot = F) # p < 2.2e-16 -> under-dispersion, small power
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.40226, p-value < 2.2e-16
## alternative hypothesis: less
plot(inland.sands.sp.rich.sim.res$fittedPredictedResponse, inland.sands.sp.rich.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nInland Sands species richness model 5')
plot(fitted(inland.sands.sp.rich.model5), residuals(inland.sands.sp.rich.model5), main = 'Response scale residuals\nInland Sands species richness model 5')
# Export these graphs:
png('Analysis/Model diagnostics/Inland Sands species richness model 5 QQ Plot.png')
plot(inland.sands.sp.rich.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Inland Sands species richness model fitted vs. scaled residuals.png')
plot(inland.sands.sp.rich.sim.res$fittedPredictedResponse, inland.sands.sp.rich.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nInland Sands species richness model 5')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Inland Sands species richness model 5 fitted vs. residuals.png')
plot(fitted(inland.sands.sp.rich.model5), residuals(inland.sands.sp.rich.model5), main = 'Response scale residuals\nInland Sands species richness model 5')
dev.off()
## png
## 2
The main issue seem to be under-dispersion, which means lower statistical power. Model back up and documentation of the model selection process:
file.remove('Analysis/Inner sands - species richness model selection.txt')
## [1] TRUE
for (model in c(ls()[grep('*inland.sands.sp.rich.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/Inner sands - species richness model selection.txt', append = T)
}
# load('Analysis/Inner sands - Species richness models.Rdata')
save(list = ls()[grep('*inland.sands.sp.rich.model', ls())], file = 'Analysis/Inner sands - Species richness models.Rdata')
capture.output(cat('The best fitting model for species richness in the inner sands is the null model.'),
summary(inland.sands.sp.rich.model5),
testDispersion(inland.sands.sp.rich.sim.res, alternative = 'greater', plot = F) ,# p = 1, suggesting under-dispersion
testDispersion(inland.sands.sp.rich.sim.res, alternative = 'less', plot = F), # p < 2.2e-16 -> under-dispersion, small power
file = 'Output/Inner sands species richness - best fitting model.txt', append = F)
# Create a table comparing species richness models:
for(model in ls()[grep('*inland.sands.sp.rich.model.', ls())]){
sp.rich.comparison <- rbind(sp.rich.comparison,
data.table(unit = 'Inner sands', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
sp.rich.comparison <- sp.rich.comparison[!(formula %like% '~' | formula %like% 'species.richness')] # remove redundant rows
sp.rich.comparison <- unique(sp.rich.comparison)
setorder(sp.rich.comparison, unit, AIC) # Sort by AIC (ascending)
sp.rich.comparison[unit == 'Inner sands', .(model, family, formula, no.of.preds, AIC, BIC)] # View the table
## model family
## 1: inland.sands.sp.rich.model4 poisson
## 2: inland.sands.sp.rich.model3 poisson
## 3: inland.sands.sp.rich.model5 poisson
## 4: inland.sands.sp.rich.model2 poisson
## 5: inland.sands.sp.rich.model1 poisson
## 6: inland.sands.sp.rich.model.full.Poisson poisson
## formula no.of.preds
## 1: cos.dist.21.June + site 2
## 2: sin.dist.21.June + cos.dist.21.June + site 3
## 3: site 1
## 4: agriculture + sin.dist.21.June + cos.dist.21.June + site 4
## 5: agriculture + dunes + sin.dist.21.June + cos.dist.21.June + site 5
## 6: agriculture * dunes + sin.dist.21.June + cos.dist.21.June + site 6
## AIC BIC
## 1: 290.1704 299.2771
## 2: 290.2652 301.6485
## 3: 291.2718 298.1018
## 4: 292.2650 305.9250
## 5: 294.2588 310.1955
## 6: 295.5957 313.8090
write_excel_csv(sp.rich.comparison, file = 'Analysis/Species richness models of reptiles - AIC comparison.csv')
rm(list = setdiff(ls()[grep('*inland.sands.sp.rich.model', ls())], c('inland.sands.sp.rich.model5'))) # Clean up
Once again, the chosen model does not contain any predictors in the researcher hypotheses (temporal trend, dune type or distance to agriculture), so we do not explore its predictions. Next, let’s move to total abundance in the inland sands. Let’s start with data visualization:
# Inland sands total reptile abundance----
ggplot(data = inland.sands, aes(x = dunes, y = total.abundance, color = agriculture)) + geom_boxplot() + facet_grid(. ~ year)
2021 seems lower than 2017 and 2019, but not other differences are
obvious visually. Let’s fit the full Poisson model:
# Inlands sands total abundance model selection----
inland.sands.total.abnd.model.full <- glmmTMB(total.abundance ~ year.count * agriculture + year.count * dunes + agriculture * dunes + sin.dist.21.June + cos.dist.21.June +
site, family = 'poisson', data = inland.sands)
summary(inland.sands.total.abnd.model.full)
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count * agriculture + year.count * dunes +
## agriculture * dunes + sin.dist.21.June + cos.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 346.0 371.1 -162.0 324.0 61
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.97236 0.86095 1.129 0.258725
## year.count -0.23702 0.05475 -4.329 1.50e-05 ***
## agricultureNear -0.32692 0.18426 -1.774 0.076036 .
## dunesshifting -0.14710 0.13215 -1.113 0.265671
## sin.dist.21.June 1.45244 0.41755 3.478 0.000504 ***
## cos.dist.21.June 1.45984 0.82860 1.762 0.078102 .
## siteSecher -0.60532 0.13683 -4.424 9.69e-06 ***
## siteShunra East -0.03756 0.11191 -0.336 0.737184
## year.count:agricultureNear 0.05121 0.06227 0.822 0.410930
## year.count:dunesshifting 0.01432 0.05341 0.268 0.788637
## agricultureNear:dunesshifting 0.32594 0.19046 1.711 0.087020 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat('PHI = ');
## PHI =
deviance(inland.sands.total.abnd.model.full)/df.residual(inland.sands.total.abnd.model.full)
## [1] 0.7221546
drop1(inland.sands.total.abnd.model.full)
## Single term deletions
##
## Model:
## total.abundance ~ year.count * agriculture + year.count * dunes +
## agriculture * dunes + sin.dist.21.June + cos.dist.21.June +
## site
## Df AIC
## <none> 346.01
## sin.dist.21.June 1 356.24
## cos.dist.21.June 1 347.19
## site 2 363.52
## year.count:agriculture 1 344.69
## year.count:dunes 1 344.08
## agriculture:dunes 1 346.95
PHI < 1, so we proceed with Poisson models. We can drop the interaction between trend and dune type:
inland.sands.total.abnd.model1 <- glmmTMB(total.abundance ~ year.count * agriculture + dunes + agriculture * dunes + sin.dist.21.June + cos.dist.21.June +
site, family = 'poisson', data = inland.sands)
summary(inland.sands.total.abnd.model1)
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count * agriculture + dunes + agriculture *
## dunes + sin.dist.21.June + cos.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 344.1 366.9 -162.0 324.1 62
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.95898 0.86039 1.115 0.265026
## year.count -0.23078 0.04950 -4.662 3.14e-06 ***
## agricultureNear -0.32893 0.18476 -1.780 0.075023 .
## dunesshifting -0.12260 0.09542 -1.285 0.198826
## sin.dist.21.June 1.45657 0.41728 3.491 0.000482 ***
## cos.dist.21.June 1.46141 0.82936 1.762 0.078051 .
## siteSecher -0.60595 0.13685 -4.428 9.52e-06 ***
## siteShunra East -0.03731 0.11191 -0.333 0.738853
## year.count:agricultureNear 0.05187 0.06224 0.833 0.404606
## agricultureNear:dunesshifting 0.32871 0.19014 1.729 0.083849 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.total.abnd.model1)
## Single term deletions
##
## Model:
## total.abundance ~ year.count * agriculture + dunes + agriculture *
## dunes + sin.dist.21.June + cos.dist.21.June + site
## Df AIC
## <none> 344.08
## sin.dist.21.June 1 354.40
## cos.dist.21.June 1 345.26
## site 2 361.63
## year.count:agriculture 1 342.78
## agriculture:dunes 1 345.08
We can also drop the interaction between trend and distance to agriculture:
inland.sands.total.abnd.model2 <- glmmTMB(total.abundance ~ year.count + agriculture * dunes + sin.dist.21.June + cos.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.total.abnd.model2)
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count + agriculture * dunes + sin.dist.21.June +
## cos.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 342.8 363.3 -162.4 324.8 63
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.78305 0.83716 0.935 0.349598
## year.count -0.21710 0.04652 -4.667 3.06e-06 ***
## agricultureNear -0.23823 0.14793 -1.610 0.107299
## dunesshifting -0.12260 0.09542 -1.285 0.198823
## sin.dist.21.June 1.50952 0.41187 3.665 0.000247 ***
## cos.dist.21.June 1.61059 0.81264 1.982 0.047489 *
## siteSecher -0.59818 0.13686 -4.371 1.24e-05 ***
## siteShunra East -0.03803 0.11204 -0.339 0.734278
## agricultureNear:dunesshifting 0.33671 0.18994 1.773 0.076283 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.total.abnd.model2)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + agriculture * dunes + sin.dist.21.June +
## cos.dist.21.June + site
## Df AIC
## <none> 342.78
## year.count 1 364.27
## sin.dist.21.June 1 354.39
## cos.dist.21.June 1 344.80
## site 2 359.78
## agriculture:dunes 1 343.92
We can drop the last interaction standing, that between dune type and distance to agriculture:
inland.sands.total.abnd.model3 <- glmmTMB(total.abundance ~ year.count + agriculture + dunes + sin.dist.21.June + cos.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.total.abnd.model3)
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count + agriculture + dunes + sin.dist.21.June +
## cos.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 343.9 362.1 -164.0 327.9 64
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.93491 0.83685 1.117 0.263920
## year.count -0.21200 0.04645 -4.564 5.02e-06 ***
## agricultureNear -0.07388 0.11205 -0.659 0.509648
## dunesshifting -0.03766 0.08242 -0.457 0.647715
## sin.dist.21.June 1.40796 0.40982 3.436 0.000591 ***
## cos.dist.21.June 1.42386 0.81000 1.758 0.078772 .
## siteSecher -0.59911 0.13712 -4.369 1.25e-05 ***
## siteShunra East -0.03871 0.11214 -0.345 0.729936
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.total.abnd.model3)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + agriculture + dunes + sin.dist.21.June +
## cos.dist.21.June + site
## Df AIC
## <none> 343.92
## year.count 1 364.36
## agriculture 1 342.36
## dunes 1 342.13
## sin.dist.21.June 1 353.92
## cos.dist.21.June 1 345.09
## site 2 360.85
We can drop the dune type altogether:
inland.sands.total.abnd.model4 <- glmmTMB(total.abundance ~ year.count + agriculture + sin.dist.21.June + cos.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.total.abnd.model4)
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count + agriculture + sin.dist.21.June +
## cos.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 342.1 358.1 -164.1 328.1 65
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.88717 0.82979 1.069 0.285004
## year.count -0.21276 0.04642 -4.583 4.57e-06 ***
## agricultureNear -0.07276 0.11203 -0.649 0.516026
## sin.dist.21.June 1.42327 0.40817 3.487 0.000489 ***
## cos.dist.21.June 1.45206 0.80704 1.799 0.071980 .
## siteSecher -0.59896 0.13708 -4.370 1.24e-05 ***
## siteShunra East -0.03861 0.11213 -0.344 0.730561
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.total.abnd.model4)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + agriculture + sin.dist.21.June +
## cos.dist.21.June + site
## Df AIC
## <none> 342.13
## year.count 1 362.78
## agriculture 1 340.55
## sin.dist.21.June 1 352.50
## cos.dist.21.June 1 343.45
## site 2 359.07
We can drop the distance to agriculture as well:
inland.sands.total.abnd.model5 <- glmmTMB(total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.total.abnd.model5)
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 340.6 354.2 -164.3 328.6 66
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.853929 0.827987 1.031 0.302385
## year.count -0.216587 0.045992 -4.709 2.49e-06 ***
## sin.dist.21.June 1.449808 0.405230 3.578 0.000347 ***
## cos.dist.21.June 1.449053 0.806896 1.796 0.072521 .
## siteSecher -0.570651 0.130393 -4.376 1.21e-05 ***
## siteShunra East -0.002674 0.097993 -0.027 0.978226
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.total.abnd.model5)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## site
## Df AIC
## <none> 340.55
## year.count 1 362.65
## sin.dist.21.June 1 351.62
## cos.dist.21.June 1 341.86
## site 2 357.35
We can drop cosine seasonality too as delta AIC < 2:
inland.sands.total.abnd.model6 <- glmmTMB(total.abundance ~ year.count + sin.dist.21.June + site, family = 'poisson', data = inland.sands)
summary(inland.sands.total.abnd.model6)
## Family: poisson ( log )
## Formula: total.abundance ~ year.count + sin.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 341.9 353.2 -165.9 331.9 67
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.33262 0.07406 31.497 < 2e-16 ***
## year.count -0.21685 0.04672 -4.641 3.47e-06 ***
## sin.dist.21.June 0.91109 0.27370 3.329 0.000872 ***
## siteSecher -0.62842 0.12721 -4.940 7.81e-07 ***
## siteShunra East 0.01253 0.09774 0.128 0.897960
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(inland.sands.total.abnd.model6)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + sin.dist.21.June + site
## Df AIC
## <none> 341.86
## year.count 1 363.32
## sin.dist.21.June 1 351.17
## site 2 364.84
No more predictors to drop. Proceed to model diagnostics:
# Inlands sands total abundance model diagnostics and back up----
inland.sands.abnd.sim.res <- simulateResiduals(inland.sands.total.abnd.model6) # simulate the residuals using DHARMa package for model diagnostics
plot(inland.sands.abnd.sim.res)
testQuantiles(inland.sands.abnd.sim.res)
##
## Test for location of quantiles via qgam
##
## data: simulationOutput
## p-value = 0.04173
## alternative hypothesis: both
plotResiduals(inland.sands.abnd.sim.res, form = inland.sands$year.count) #
plotResiduals(inland.sands.abnd.sim.res, form = inland.sands$sin.dist.21.June) #
testDispersion(inland.sands.abnd.sim.res, alternative = 'greater') # p = 1, suggesting under-dispersion
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.80667, p-value = 0.88
## alternative hypothesis: greater
testDispersion(inland.sands.abnd.sim.res, alternative = 'less', plot = F) # p < 2.2e-16 -> under-dispersion, small power
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.80667, p-value = 0.12
## alternative hypothesis: less
plot(inland.sands.abnd.sim.res$fittedPredictedResponse, inland.sands.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nInland Sands abundance model 5')
plot(fitted(inland.sands.total.abnd.model6), residuals(inland.sands.total.abnd.model6), main = 'Response scale residuals\nInland Sands abundance model 5')
# Export these graphs:
png('Analysis/Model diagnostics/Inland Sands abundance model 5 QQ Plot.png')
plot(inland.sands.abnd.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Inland Sands abundance model fitted vs. scaled residuals.png')
plot(inland.sands.abnd.sim.res$fittedPredictedResponse, inland.sands.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nInland Sands abundance model 5')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Inland Sands abundance model 5 fitted vs. residuals.png')
plot(fitted(inland.sands.total.abnd.model6), residuals(inland.sands.total.abnd.model6), main = 'Response scale residuals\nInland Sands abundance model 5')
dev.off()
## png
## 2
The quantile test is significant, which means that there is some non-linearity in the data that is not captured by the model (according to this answer: https://stats.stackexchange.com/questions/548478/how-to-interpret-meaning-of-residual-vs-predicted-quantile-plots-in-dharma)
# The chosen model is inland.sands.total.abnd.model6 - temporal trend and seasonal pattern
summary(inland.sands.total.abnd.model6)
## Family: poisson ( log )
## Formula: total.abundance ~ year.count + sin.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 341.9 353.2 -165.9 331.9 67
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.33262 0.07406 31.497 < 2e-16 ***
## year.count -0.21685 0.04672 -4.641 3.47e-06 ***
## sin.dist.21.June 0.91109 0.27370 3.329 0.000872 ***
## siteSecher -0.62842 0.12721 -4.940 7.81e-07 ***
## siteShunra East 0.01253 0.09774 0.128 0.897960
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
hist(resid(inland.sands.total.abnd.model6)) # mostly from -4 to +4
quantile(resid(inland.sands.total.abnd.model6)) # inter-quartile range: -1.7 to 0.9; median = -0.3
## 0% 25% 50% 75% 100%
## -5.1444565 -1.6155567 -0.6219748 0.7829934 7.3716070
file.remove('Analysis/inland.sandsal Dunes - total abundance model selection.txt')
## Warning in file.remove("Analysis/inland.sandsal Dunes - total abundance model
## selection.txt"): cannot remove file 'Analysis/inland.sandsal Dunes - total
## abundance model selection.txt', reason 'No such file or directory'
## [1] FALSE
for (model in c(ls()[grep('*inland.sands.total.abnd.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/inland sands - total abundance model selection.txt', append = T)
}
# load('Analysis/inland sands - total abundance models.Rdata')
save(list = ls()[grep('*inland.sands.total.abnd.model', ls())], file = 'Analysis/inland sands - total abundance models.Rdata')
capture.output(cat('The best fitting model for total abundance in the inland.sands is inland.sands.total.abnd.model6.'),
summary(inland.sands.total.abnd.model6),
cat('\n----\nTest for quantile deviation for the trend:\n'),
testQuantiles(inland.sands.abnd.sim.res, predictor = inland.sands$year.count, plot = F), #
cat('\n----\nTest for quantile deviation for the sine seasonality:\n'),
testQuantiles(inland.sands.abnd.sim.res, predictor = inland.sands$sin.dist.21.June, plot = F), #
file = 'Output/inland.sands total abundance - best fitting model.txt', append = F)
## qu = 0.25, log(sigma) = -2.547605 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.220345 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.018088 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.271723 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.154702 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.195272 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.23997 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.210768 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.227841 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.216687 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.222775 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.218948 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.221273 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.219812 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.2207 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.220919 : outer Newton did not converge fully.
## qu = 0.25, log(sigma) = -2.220564 : outer Newton did not converge fully.
## Warning in newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L,
## : Fitting terminated with step failure - check results carefully
## qu = 0.5, log(sigma) = -2.547605 : outer Newton did not converge fully.
## qu = 0.5, log(sigma) = -2.220345 : outer Newton did not converge fully.
## qu = 0.5, log(sigma) = -1.974807 : outer Newton did not converge fully.
## qu = 0.5, log(sigma) = -1.933375 : outer Newton did not converge fully.
## qu = 0.5, log(sigma) = -1.958981 : outer Newton did not converge fully.
## qu = 0.5, log(sigma) = -1.974506 : outer Newton did not converge fully.
## qu = 0.5, log(sigma) = -1.975159 : outer Newton did not converge fully.
## qu = 0.75, log(sigma) = -2.547605 : outer Newton did not converge fully.
## Unable to calculate quantile regression for quantile 0.75. Possibly to few (unique) data points / predictions. Will be ommited in plots and significance calculations.
# Create a table comparing total abundance models:
for(model in setdiff(ls()[grep('*inland.sands.total.abnd.model.', ls())], "inland.sands.total.abnd.model8.effect.plot")){
total.abnd.comparison <- rbind(total.abnd.comparison,
data.table(unit = 'Inland Sands', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
total.abnd.comparison <- total.abnd.comparison[!(formula %like% '~' | formula %like% 'total.abundance')] # remove redundant rows
total.abnd.comparison <- unique(total.abnd.comparison)
setorder(total.abnd.comparison, unit, AIC) # Sort by AIC (ascending)
total.abnd.comparison[unit == 'Inland Sands', .(model, family, formula, no.of.preds, AIC, BIC)] # View the table
## model family
## 1: inland.sands.total.abnd.model5 poisson
## 2: inland.sands.total.abnd.model6 poisson
## 3: inland.sands.total.abnd.model4 poisson
## 4: inland.sands.total.abnd.model2 poisson
## 5: inland.sands.total.abnd.model3 poisson
## 6: inland.sands.total.abnd.model1 poisson
## 7: inland.sands.total.abnd.model.full poisson
## formula
## 1: year.count + sin.dist.21.June + cos.dist.21.June + site
## 2: year.count + sin.dist.21.June + site
## 3: year.count + agriculture + sin.dist.21.June + cos.dist.21.June + site
## 4: year.count + agriculture * dunes + sin.dist.21.June + cos.dist.21.June + site
## 5: year.count + agriculture + dunes + sin.dist.21.June + cos.dist.21.June + site
## 6: year.count * agriculture + dunes + agriculture * dunes + sin.dist.21.June + cos.dist.21.June + site
## 7: year.count * agriculture + year.count * dunes + agriculture * dunes + sin.dist.21.June + cos.dist.21.June + site
## no.of.preds AIC BIC
## 1: 4 340.5546 354.2146
## 2: 3 341.8627 353.2460
## 3: 5 342.1321 358.0688
## 4: 7 342.7753 363.2653
## 5: 6 343.9232 362.1366
## 6: 8 344.0837 366.8504
## 7: 9 346.0119 371.0552
write_excel_csv(total.abnd.comparison, file = 'Analysis/Reptiles total abundance models of reptiles - AIC comparison.csv')
rm(list = setdiff(ls()[grep('*inland.sands.total.abnd.model', ls())], c('inland.sands.total.abnd.model6'))) # Clean up
This time, the chosen model includes the trend, so let’s explore its predictions:
# Inland sands total abundance model predictions----
summary(inland.sands.total.abnd.model6)
## Family: poisson ( log )
## Formula: total.abundance ~ year.count + sin.dist.21.June + site
## Data: inland.sands
##
## AIC BIC logLik deviance df.resid
## 341.9 353.2 -165.9 331.9 67
##
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.33262 0.07406 31.497 < 2e-16 ***
## year.count -0.21685 0.04672 -4.641 3.47e-06 ***
## sin.dist.21.June 0.91109 0.27370 3.329 0.000872 ***
## siteSecher -0.62842 0.12721 -4.940 7.81e-07 ***
## siteShunra East 0.01253 0.09774 0.128 0.897960
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Predict by the mean observed values
reptiles[, sort(unique(unit))]
## [1] Coastal Plain Sands
## [2] Inland Sands
## [3] Loess Covered Areas in the Northern Negev
## [4] Mediterranean-Desert Transition Zone
## [5] Planted Conifer Forests
## 5 Levels: Coastal Plain Sands ... Planted Conifer Forests
quantile(reptiles[unit == 'Inland Sands', .(day.of.year = unique(yday(date))), by = survey_ID][, day.of.year])
## 0% 25% 50% 75% 100%
## 171.0 193.5 201.0 201.0 232.0
# Dates vary from 171 (June 20th) to 232 (August 20th) with a median of 201 (July 20th)
## Calculate the mean radian angle of the date and time of sampling and use this for model fit to predict trends
# Create a table to be filled by a loop with predictor values to be used for predictions
reptiles[unit %like% 'Inland', .(no.of.surveys = uniqueN(survey_ID)), keyby = yday(Date)] # day 202 is the most common date
## yday no.of.surveys
## 1: 165 6
## 2: 170 6
## 3: 177 6
## 4: 182 6
## 5: 188 9
## 6: 196 8
## 7: 202 10
## 8: 206 6
## 9: 217 6
## 10: 227 9
yday(as.Date('2021-07-20')) # 21 July is day 201 in non-leap years
## [1] 201
reptiles[unit %like% 'Inland', .(no.of.surveys = uniqueN(survey_ID)), keyby = month(Date)] # July is the most common month
## month no.of.surveys
## 1: 6 18
## 2: 7 39
## 3: 8 15
# Plot the model seasonal pattern
inland.sands.total.abnd.seas.pred <- data.table(expand.grid(Date = seq.Date(as.Date('2017-01-01'),
as.Date('2021-12-31'), by = 1), site = 'Shunra East'))
inland.sands.total.abnd.seas.pred[, ':=' (year = year(Date),
dist.21.June = ifelse(yday(Date) < 354,
Date - as.Date(paste(year(Date), 6, 21, sep = '-')),
Date - as.Date(paste(year(Date) + 1, 6, 21, sep = '-'))))]
inland.sands.total.abnd.seas.pred <- inland.sands.total.abnd.seas.pred[year %in% c(2017, 2019, 2021)]
inland.sands.total.abnd.seas.pred[, ':=' (dist.21.June.radians = dist.21.June * pi / 182.5, # Convert to radians (multiply by pi and divide by half the number of days in a year), one harmonic
dist.21.June.radians.2h = 2*dist.21.June * pi / 182.5)]
setorder(inland.sands.total.abnd.seas.pred, Date, dist.21.June.radians)
inland.sands.total.abnd.seas.pred[, ':=' (year.count = year - min(year))]
inland.sands.total.abnd.seas.pred[, ':=' (sin.dist.21.June = sin(dist.21.June.radians), cos.dist.21.June = cos(dist.21.June.radians))] # Calculate the sin and cosine of the distance from June 21st
inland.sands.total.abnd.seas.pred
## Date site year dist.21.June dist.21.June.radians
## 1: 2017-01-01 Shunra East 2017 -171 -2.943629
## 2: 2017-01-02 Shunra East 2017 -170 -2.926415
## 3: 2017-01-03 Shunra East 2017 -169 -2.909201
## 4: 2017-01-04 Shunra East 2017 -168 -2.891987
## 5: 2017-01-05 Shunra East 2017 -167 -2.874772
## ---
## 1091: 2021-12-27 Shunra East 2021 -176 -3.029700
## 1092: 2021-12-28 Shunra East 2021 -175 -3.012486
## 1093: 2021-12-29 Shunra East 2021 -174 -2.995272
## 1094: 2021-12-30 Shunra East 2021 -173 -2.978058
## 1095: 2021-12-31 Shunra East 2021 -172 -2.960843
## dist.21.June.radians.2h year.count sin.dist.21.June cos.dist.21.June
## 1: -5.887259 0 -0.1966729 -0.9804692
## 2: -5.852830 0 -0.2135209 -0.9769385
## 3: -5.818402 0 -0.2303057 -0.9731183
## 4: -5.783973 0 -0.2470222 -0.9690098
## 5: -5.749545 0 -0.2636655 -0.9646142
## ---
## 1091: -6.059401 4 -0.1116590 -0.9937466
## 1092: -6.024972 4 -0.1287482 -0.9916773
## 1093: -5.990544 4 -0.1457992 -0.9893142
## 1094: -5.956115 4 -0.1628070 -0.9866579
## 1095: -5.921687 4 -0.1797666 -0.9837093
plot(inland.sands.total.abnd.seas.pred[year == 2017, Date], inland.sands.total.abnd.seas.pred[year == 2017,sin.dist.21.June],
main = 'Sine of distance to June 21st') # sanity check - should be a wave
plot(inland.sands.total.abnd.seas.pred[year == 2017, Date], inland.sands.total.abnd.seas.pred[year == 2017,cos.dist.21.June],
main = 'Cosine of distance to June 21st') # sanity check - should be a wave
bla <- predict(inland.sands.total.abnd.model6, newdata = inland.sands.total.abnd.seas.pred, type = 'response', se.fit = T)
inland.sands.total.abnd.seas.pred[, ':=' (predicted.abnd = bla$fit, predicted.abnd.se = bla$se.fit)]
# inland.sands.total.abnd.seas.pred[, .(year, predicted.abnd, predicted.abnd.se)]
inland.sands.total.abnd.seas.pred
## Date site year dist.21.June dist.21.June.radians
## 1: 2017-01-01 Shunra East 2017 -171 -2.943629
## 2: 2017-01-02 Shunra East 2017 -170 -2.926415
## 3: 2017-01-03 Shunra East 2017 -169 -2.909201
## 4: 2017-01-04 Shunra East 2017 -168 -2.891987
## 5: 2017-01-05 Shunra East 2017 -167 -2.874772
## ---
## 1091: 2021-12-27 Shunra East 2021 -176 -3.029700
## 1092: 2021-12-28 Shunra East 2021 -175 -3.012486
## 1093: 2021-12-29 Shunra East 2021 -174 -2.995272
## 1094: 2021-12-30 Shunra East 2021 -173 -2.978058
## 1095: 2021-12-31 Shunra East 2021 -172 -2.960843
## dist.21.June.radians.2h year.count sin.dist.21.June cos.dist.21.June
## 1: -5.887259 0 -0.1966729 -0.9804692
## 2: -5.852830 0 -0.2135209 -0.9769385
## 3: -5.818402 0 -0.2303057 -0.9731183
## 4: -5.783973 0 -0.2470222 -0.9690098
## 5: -5.749545 0 -0.2636655 -0.9646142
## ---
## 1091: -6.059401 4 -0.1116590 -0.9937466
## 1092: -6.024972 4 -0.1287482 -0.9916773
## 1093: -5.990544 4 -0.1457992 -0.9893142
## 1094: -5.956115 4 -0.1628070 -0.9866579
## 1095: -5.921687 4 -0.1797666 -0.9837093
## predicted.abnd predicted.abnd.se
## 1: 8.723036 0.9320347
## 2: 8.590160 0.9393663
## 3: 8.459795 0.9473594
## 4: 8.331926 0.9558884
## 5: 8.206538 0.9648395
## ---
## 1091: 3.959157 0.8430854
## 1092: 3.897991 0.8461737
## 1093: 3.837904 0.8490423
## 1094: 3.778891 0.8516919
## 1095: 3.720950 0.8541239
# plot the seasonal predictions
ggplot(data = inland.sands.total.abnd.seas.pred, aes(x = as.Date(paste(2017, month(Date), mday(Date), sep = '-')), y = predicted.abnd)) + geom_line() +
geom_point(data = reptiles[unit %like% 'Inland', .(total.abnd = sum(count_individuals, na.rm = T)),
keyby = .(survey_ID, year(Date), as.Date(paste(2017, month(Date), mday(Date), sep = '-')))],
aes(x = as.Date, y = total.abnd)) + labs(x = 'Date', y = 'Abundance', title = 'Inland Sands Reptiles',
subtitle = 'Predicted and observed abundance') +
facet_wrap(. ~ year) +
scale_x_date(date_labels = '%d/%m') # The predictions are much lower than the observations
ggsave('Analysis/inland.sands.total.abnd.model6 seasonal Predictions and observations in reptile total abundance in Inland Sands.png')
## Saving 7 x 5 in image
The seasonal pattern of the model suggests a peak in September, when no surveys were conducted… We will take July 20th predictions instead. Let’s prepare the data for prediction:
# Create a data.table for predictions
inland.sands.total.abnd.fit.data <- data.table(expand.grid(year = unique(c(inland.sands[, min(year)], inland.sands[, max(year)], seq(from = inland.sands[, min(year)], to = inland.sands[, max(year)+1], by = inland.sands[, uniqueN(year)/100]))), site = inland.sands[, unique(site)]))
inland.sands.total.abnd.fit.data[, Date := as.Date(paste(floor(year), '07', '20', sep = '-'))]
inland.sands.total.abnd.fit.data[, ':=' (dist.21.June = ifelse(yday(Date) < 354,
Date - as.Date(paste(year(Date), 6, 21, sep = '-')),
Date - as.Date(paste(year(Date) + 1, 6, 21, sep = '-'))))]
inland.sands.total.abnd.fit.data[, ':=' (dist.21.June.radians = dist.21.June * pi / 182.5, # Convert to radians (multiply by pi and divide by half the number of days in a year), one harmonic
dist.21.June.radians.2h = 2*dist.21.June * pi / 182.5)]
setorder(inland.sands.total.abnd.fit.data, year, dist.21.June.radians)
inland.sands.total.abnd.fit.data # seems ok
## year site Date dist.21.June dist.21.June.radians
## 1: 2017.00 Beer Milka 2017-07-20 29 0.499212
## 2: 2017.00 Secher 2017-07-20 29 0.499212
## 3: 2017.00 Shunra East 2017-07-20 29 0.499212
## 4: 2017.03 Beer Milka 2017-07-20 29 0.499212
## 5: 2017.03 Secher 2017-07-20 29 0.499212
## ---
## 500: 2021.95 Secher 2021-07-20 29 0.499212
## 501: 2021.95 Shunra East 2021-07-20 29 0.499212
## 502: 2021.98 Beer Milka 2021-07-20 29 0.499212
## 503: 2021.98 Secher 2021-07-20 29 0.499212
## 504: 2021.98 Shunra East 2021-07-20 29 0.499212
## dist.21.June.radians.2h
## 1: 0.998424
## 2: 0.998424
## 3: 0.998424
## 4: 0.998424
## 5: 0.998424
## ---
## 500: 0.998424
## 501: 0.998424
## 502: 0.998424
## 503: 0.998424
## 504: 0.998424
inland.sands.total.abnd.fit.data[, ':=' (year.count = year - min(year))]
inland.sands.total.abnd.fit.data[, ':=' (sin.dist.21.June = sin(dist.21.June.radians), cos.dist.21.June = cos(dist.21.June.radians))] # Calculate the sin and cosine of the distance from June 21st
inland.sands.total.abnd.fit.data
## year site Date dist.21.June dist.21.June.radians
## 1: 2017.00 Beer Milka 2017-07-20 29 0.499212
## 2: 2017.00 Secher 2017-07-20 29 0.499212
## 3: 2017.00 Shunra East 2017-07-20 29 0.499212
## 4: 2017.03 Beer Milka 2017-07-20 29 0.499212
## 5: 2017.03 Secher 2017-07-20 29 0.499212
## ---
## 500: 2021.95 Secher 2021-07-20 29 0.499212
## 501: 2021.95 Shunra East 2021-07-20 29 0.499212
## 502: 2021.98 Beer Milka 2021-07-20 29 0.499212
## 503: 2021.98 Secher 2021-07-20 29 0.499212
## 504: 2021.98 Shunra East 2021-07-20 29 0.499212
## dist.21.June.radians.2h year.count sin.dist.21.June cos.dist.21.June
## 1: 0.998424 0.00 0.4787338 0.8779601
## 2: 0.998424 0.00 0.4787338 0.8779601
## 3: 0.998424 0.00 0.4787338 0.8779601
## 4: 0.998424 0.03 0.4787338 0.8779601
## 5: 0.998424 0.03 0.4787338 0.8779601
## ---
## 500: 0.998424 4.95 0.4787338 0.8779601
## 501: 0.998424 4.95 0.4787338 0.8779601
## 502: 0.998424 4.98 0.4787338 0.8779601
## 503: 0.998424 4.98 0.4787338 0.8779601
## 504: 0.998424 4.98 0.4787338 0.8779601
Predict the total abundance trend:
bla <- predict(inland.sands.total.abnd.model6, newdata = inland.sands.total.abnd.fit.data, type = 'response', se.fit = T)
inland.sands.total.abnd.fit.data[, ':=' (predicted.abnd = bla$fit, predicted.abnd.se = bla$se.fit)]
inland.sands.total.abnd.fit.data[site == inland.sands[, sort(unique(site))[1]] & year == floor(year), .(predicted.abnd = mean(predicted.abnd), predicted.abnd.se = mean(predicted.abnd.se)), keyby = .(year = floor(year))] # From 15.9 in 2017 to 6.7 individuals in 2021
## year predicted.abnd predicted.abnd.se
## 1: 2017 15.939336 2.1747636
## 2: 2020 8.316540 0.5306563
## 3: 2021 6.695251 0.5971909
inland.sands.total.abnd.fit.data[year == min(year) & site == inland.sands[, sort(unique(site))[1]], .(predicted.abnd = mean(predicted.abnd), predicted.abnd.se = mean(predicted.abnd.se)), keyby = .(year, site)] # From 15.9 reptiles per plot in 2017...
## year site predicted.abnd predicted.abnd.se
## 1: 2017 Beer Milka 15.93934 2.174764
inland.sands.total.abnd.fit.data[year == max(floor(year)) & site == inland.sands[, sort(unique(site))[1]], .(predicted.abnd = mean(predicted.abnd), predicted.abnd.se = mean(predicted.abnd.se)), keyby = .(year, site)] # ...to 5.4 in 2021
## year site predicted.abnd predicted.abnd.se
## 1: 2021 Beer Milka 6.695251 0.5971909
cat('Percent decline in total reptile abundance in the inland sands: '); 1 - inland.sands.total.abnd.fit.data[year == max(floor(year)) & site == inland.sands[, sort(unique(site))[1]], round(mean(predicted.abnd), 1)] / inland.sands.total.abnd.fit.data[year == min(year) & site == inland.sands[, sort(unique(site))[1]], round(mean(predicted.abnd),1)]
## Percent decline in total reptile abundance in the inland sands:
## [1] 0.5786164
inland.sands.total.abnd.fit.data # Now the predictions finally make sense!
## year site Date dist.21.June dist.21.June.radians
## 1: 2017.00 Beer Milka 2017-07-20 29 0.499212
## 2: 2017.00 Secher 2017-07-20 29 0.499212
## 3: 2017.00 Shunra East 2017-07-20 29 0.499212
## 4: 2017.03 Beer Milka 2017-07-20 29 0.499212
## 5: 2017.03 Secher 2017-07-20 29 0.499212
## ---
## 500: 2021.95 Secher 2021-07-20 29 0.499212
## 501: 2021.95 Shunra East 2021-07-20 29 0.499212
## 502: 2021.98 Beer Milka 2021-07-20 29 0.499212
## 503: 2021.98 Secher 2021-07-20 29 0.499212
## 504: 2021.98 Shunra East 2021-07-20 29 0.499212
## dist.21.June.radians.2h year.count sin.dist.21.June cos.dist.21.June
## 1: 0.998424 0.00 0.4787338 0.8779601
## 2: 0.998424 0.00 0.4787338 0.8779601
## 3: 0.998424 0.00 0.4787338 0.8779601
## 4: 0.998424 0.03 0.4787338 0.8779601
## 5: 0.998424 0.03 0.4787338 0.8779601
## ---
## 500: 0.998424 4.95 0.4787338 0.8779601
## 501: 0.998424 4.95 0.4787338 0.8779601
## 502: 0.998424 4.98 0.4787338 0.8779601
## 503: 0.998424 4.98 0.4787338 0.8779601
## 504: 0.998424 4.98 0.4787338 0.8779601
## predicted.abnd predicted.abnd.se
## 1: 15.939336 2.1747636
## 2: 8.502574 1.0205570
## 3: 16.140369 2.5376144
## 4: 15.835980 2.1408416
## 5: 8.447441 1.0069700
## ---
## 500: 2.906565 0.5438462
## 501: 5.517509 0.7353079
## 502: 5.413455 0.6847349
## 503: 2.887718 0.5437891
## 504: 5.481731 0.7363576
write_excel_csv(inland.sands.total.abnd.fit.data, 'Output/Reptile predicted total abundance in the Inland Sands model6.csv')
Plot the total abundance trend:
# Effect plot of annual trend
inland.sands.total.abnd.effect.plot <- effect_plot(model = inland.sands.total.abnd.model6, pred = year.count, data = inland.sands, colors = "Qual1", line.colors = 'black', point.alpha = 0.25, interval = T, plot.points = F, partial.residuals = F, jitter = c(0.1,0), int.type = 'confidence', legend.main = strReverse('בית גידול')) +
theme_minimal() + labs(x = NULL, y = strReverse('שפע')) +
scale_x_continuous(breaks = inland.sands[, sort(unique(year.count))], labels = inland.sands[, .(year = unique(year)), keyby = year.count][, year]) +
theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom',
text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major.y = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.major.x = element_blank(), panel.grid.minor.x = element_blank())
## Warning in check_dots(..., .action = "warning"): unknown arguments: interval
inland.sands.total.abnd.effect.plot
Cairo::Cairo(file = 'Figures/Inland sands total abundance model6 effect plot - temporal trend.pdf', width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(inland.sands.total.abnd.effect.plot)
dev.off()
## png
## 2
# Fake effect plot of annual trend
inland.sands.total.abnd.fake.effect.plot <- ggplot(data = inland.sands.total.abnd.fit.data[year <= 2021 & site == inland.sands[, sort(unique(site))[1]], .(predicted.abnd, predicted.abnd.se), keyby = year], aes(x = year, y = predicted.abnd)) + geom_ribbon(aes(x = year, ymin = predicted.abnd - 1.96*predicted.abnd.se, ymax = predicted.abnd + 1.96*predicted.abnd.se), alpha = 0.25, color = NA) +
geom_line(linewidth = 1) + labs(y = strReverse('שפע כולל'), x = NULL) +
theme_minimal() + theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom',
text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.minor.x = element_blank())
inland.sands.total.abnd.fake.effect.plot
Cairo::Cairo(file = 'Figures/Inland sands total abundance model6 FAKE effect plot - temporal trend.pdf', width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(inland.sands.total.abnd.fake.effect.plot)
dev.off()
## png
## 2
Some data exploration:
reptiles[unit %like% 'Loess' & !is.na(SciName), .(total.abnd = sum(count_individuals), total.sp.rich = uniqueN(SciName))]
## total.abnd total.sp.rich
## 1: 283 23
## Loess species richness----
loess <- alpha.div[unit == 'Loess Covered Areas in the Northern Negev']
loess[campaign == 'T0', ':=' (year = 2014, year.fct = as.factor(2014))]
str(loess)
## Classes 'data.table' and 'data.frame': 112 obs. of 23 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 11 11 11 14 14 14 24 24 24 24 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 86 87 90 109 110 111 188 189 190 192 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 40 41 42 49 50 51 88 89 90 91 ...
## $ Date : Date, format: "2014-06-16" "2014-06-16" ...
## $ sin.dist.21.June : num -0.086 -0.086 -0.086 0.171 0.171 ...
## $ cos.dist.21.June : num 0.996 0.996 0.996 0.985 0.985 ...
## $ sin.dist.noon : num -0.165 -0.375 -0.676 -0.375 -0.462 ...
## $ cos.dist.noon : num 0.986 0.927 0.737 0.927 0.887 ...
## $ settlements : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: NA NA NA NA NA NA NA NA NA NA ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: 1 1 1 1 1 1 1 1 1 2 ...
## $ mean.lon : num 34.7 34.7 NaN 34.8 34.8 ...
## $ mean.lat : num 31.3 31.3 NaN 31.4 31.4 ...
## $ species.richness : num 2 1 0 1 2 1 2 1 1 0 ...
## $ total.abundance : num 6 3 0 4 7 4 6 2 5 0 ...
## $ geom.mean.abundance: num 2.24 3 0 4 2.45 ...
## $ year.count : num 0 0 0 0 0 0 0 0 0 0 ...
## $ year.fct : Factor w/ 8 levels "2014","2015",..: 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "sorted")= chr "unit"
## - attr(*, ".internal.selfref")=<externalptr>
loess[is.na(habitat)] # no missing variables
## Empty data.table (0 rows and 23 cols): unit,year,campaign,subunit,site,point_name...
loess[, sort(unique(year)), keyby = campaign] # 2014-2020 every 2 years
## campaign V1
## 1: T0 2014
## 2: T1 2016
## 3: T2 2018
## 4: T3 2020
loess[, .(no.of.sites = uniqueN(site)), keyby = .(campaign, year)]
## campaign year no.of.sites
## 1: T0 2014 6
## 2: T1 2016 7
## 3: T2 2018 7
## 4: T3 2020 7
loess[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(campaign, year, site)]
## campaign year site no.of.surveys
## 1: T0 2014 Eshel Hanasi 3
## 2: T0 2014 Givot Bar 3
## 3: T0 2014 Mishmar Hanegev 6
## 4: T0 2014 Nahal Ashan 6
## 5: T0 2014 Park Loess 3
## 6: T0 2014 Sayeret Shaked 6
## 7: T1 2016 Eshel Hanasi 3
## 8: T1 2016 Givot Bar 3
## 9: T1 2016 Goral 3
## 10: T1 2016 Mishmar Hanegev 6
## 11: T1 2016 Nahal Ashan 6
## 12: T1 2016 Park Loess 3
## 13: T1 2016 Sayeret Shaked 6
## 14: T2 2018 Eshel Hanasi 2
## 15: T2 2018 Givot Bar 2
## 16: T2 2018 Goral 3
## 17: T2 2018 Mishmar Hanegev 6
## 18: T2 2018 Nahal Ashan 6
## 19: T2 2018 Park Loess 3
## 20: T2 2018 Sayeret Shaked 6
## 21: T3 2020 Eshel Hanasi 2
## 22: T3 2020 Givot Bar 1
## 23: T3 2020 Goral 3
## 24: T3 2020 Mishmar Hanegev 6
## 25: T3 2020 Nahal Ashan 6
## 26: T3 2020 Park Loess 3
## 27: T3 2020 Sayeret Shaked 6
## campaign year site no.of.surveys
loess[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(campaign, year, site, habitat)]
## campaign year site habitat no.of.surveys
## 1: T0 2014 Eshel Hanasi bedouin agriculture 3
## 2: T0 2014 Givot Bar bedouin agriculture 3
## 3: T0 2014 Mishmar Hanegev bedouin agriculture 3
## 4: T0 2014 Mishmar Hanegev kkl plantings 3
## 5: T0 2014 Nahal Ashan kkl plantings 3
## 6: T0 2014 Nahal Ashan loess 3
## 7: T0 2014 Park Loess loess 3
## 8: T0 2014 Sayeret Shaked kkl plantings 3
## 9: T0 2014 Sayeret Shaked loess 3
## 10: T1 2016 Eshel Hanasi bedouin agriculture 3
## 11: T1 2016 Givot Bar bedouin agriculture 3
## 12: T1 2016 Goral bedouin agriculture 3
## 13: T1 2016 Mishmar Hanegev bedouin agriculture 3
## 14: T1 2016 Mishmar Hanegev kkl plantings 3
## 15: T1 2016 Nahal Ashan kkl plantings 3
## 16: T1 2016 Nahal Ashan loess 3
## 17: T1 2016 Park Loess loess 3
## 18: T1 2016 Sayeret Shaked kkl plantings 3
## 19: T1 2016 Sayeret Shaked loess 3
## 20: T2 2018 Eshel Hanasi bedouin agriculture 2
## 21: T2 2018 Givot Bar bedouin agriculture 2
## 22: T2 2018 Goral bedouin agriculture 3
## 23: T2 2018 Mishmar Hanegev bedouin agriculture 3
## 24: T2 2018 Mishmar Hanegev kkl plantings 3
## 25: T2 2018 Nahal Ashan kkl plantings 3
## 26: T2 2018 Nahal Ashan loess 3
## 27: T2 2018 Park Loess loess 3
## 28: T2 2018 Sayeret Shaked kkl plantings 3
## 29: T2 2018 Sayeret Shaked loess 3
## 30: T3 2020 Eshel Hanasi bedouin agriculture 2
## 31: T3 2020 Givot Bar bedouin agriculture 1
## 32: T3 2020 Goral bedouin agriculture 3
## 33: T3 2020 Mishmar Hanegev bedouin agriculture 3
## 34: T3 2020 Mishmar Hanegev kkl plantings 3
## 35: T3 2020 Nahal Ashan kkl plantings 3
## 36: T3 2020 Nahal Ashan loess 3
## 37: T3 2020 Park Loess loess 3
## 38: T3 2020 Sayeret Shaked kkl plantings 3
## 39: T3 2020 Sayeret Shaked loess 3
## campaign year site habitat no.of.surveys
# The relevant predictors are habitat and temporal trend
# Dot plots
loess.sp.rich.dotplot <- ggplot(data = loess, aes(x = species.richness, y = site)) +
geom_point(aes(color = habitat)) + geom_line(aes(group = site)) +
facet_grid(campaign ~ .) + labs(title = 'Reptile Species Richness in the Loess', y = 'Site', x = 'Species Richness', color = 'Habitat') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, loess[, max(species.richness)]),
breaks = seq(0, loess[, max(species.richness)], by = 2)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
loess.sp.rich.dotplot
ggsave('Figures/Reptile species richness in the Loess - dotplot.png', plot = loess.sp.rich.dotplot)
## Saving 7 x 5 in image
loess.abnd.dotplot <- ggplot(data = loess, aes(x = total.abundance, y = site)) +
geom_point(aes(color = habitat)) + geom_line(aes(group = site)) +
facet_grid(campaign ~ .) + labs(title = 'Reptile Total Abundance in the Loess', y = 'Site', x = 'Total Abundance', color = 'Habitat') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, loess[, max(total.abundance) + 1]),
breaks = seq(0, loess[, max(total.abundance) + 1], by = 2)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
loess.abnd.dotplot
ggsave('Figures/Reptile Total Abundance in the Loess - dotplot.png', plot = loess.abnd.dotplot)
## Saving 7 x 5 in image
Next, study species richness in the loess. Let’s start with data visualization:
# Plot species richness
ggplot(data = loess, aes(x = habitat, color = habitat, y = species.richness)) + geom_boxplot() +
geom_jitter(height = 0, width = 0.3) + facet_wrap(. ~ year) + theme_bw()
Habitat and annual differences seem minor
Next, model selection, starting from the full model with Poisson response:
# Species richness model selection----
loess.sp.rich.model.full.Poisson <- glmmTMB(species.richness ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'poisson', data = loess)
summary(loess.sp.rich.model.full.Poisson) # AIC = 314.3 BIC = 344.2
## Family: poisson ( log )
## Formula: species.richness ~ year.count * habitat + sin.dist.21.June +
## cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 314.3 344.2 -146.1 292.3 101
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 1.314e-09 3.625e-05
## Number of obs: 112, groups: site, 7
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.588243 0.774277 2.051 0.04024 *
## year.count -0.069082 0.078805 -0.877 0.38069
## habitatkkl plantings -0.187927 0.356140 -0.528 0.59772
## habitatloess 0.224795 0.344482 0.653 0.51404
## sin.dist.21.June 0.661342 0.403815 1.638 0.10148
## cos.dist.21.June -2.361546 0.832444 -2.837 0.00456 **
## sin.dist.noon 0.521905 0.218384 2.390 0.01686 *
## cos.dist.noon 1.212698 0.520543 2.330 0.01982 *
## year.count:habitatkkl plantings 0.116072 0.099239 1.170 0.24215
## year.count:habitatloess 0.007714 0.096967 0.080 0.93660
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat('PHI = '); deviance(loess.sp.rich.model.full.Poisson)/df.residual(loess.sp.rich.model.full.Poisson)
## PHI =
## [1] 0.6117383
drop1(loess.sp.rich.model.full.Poisson) # Can drop the interaction
## Single term deletions
##
## Model:
## species.richness ~ year.count * habitat + sin.dist.21.June +
## cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 314.26
## sin.dist.21.June 1 314.94
## cos.dist.21.June 1 319.92
## sin.dist.noon 1 318.17
## cos.dist.noon 1 318.34
## year.count:habitat 2 312.25
Since PHI < 1, we proceed with Poisson models. We can drop the interaction between trend and habitat.
loess.sp.rich.model1 <- glmmTMB(species.richness ~ year.count + habitat + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'poisson', data = loess)
summary(loess.sp.rich.model1)
## Family: poisson ( log )
## Formula: species.richness ~ year.count + habitat + sin.dist.21.June +
## cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 312.3 336.7 -147.1 294.3 103
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 1.575e-09 3.969e-05
## Number of obs: 112, groups: site, 7
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.57511 0.73435 2.145 0.03196 *
## year.count -0.02541 0.04211 -0.603 0.54623
## habitatkkl plantings 0.14480 0.21622 0.670 0.50308
## habitatloess 0.23287 0.23642 0.985 0.32464
## sin.dist.21.June 0.67276 0.40475 1.662 0.09648 .
## cos.dist.21.June -2.36570 0.82226 -2.877 0.00401 **
## sin.dist.noon 0.55166 0.21752 2.536 0.01121 *
## cos.dist.noon 1.09770 0.49983 2.196 0.02808 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(loess.sp.rich.model1)
## Single term deletions
##
## Model:
## species.richness ~ year.count + habitat + sin.dist.21.June +
## cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 312.25
## year.count 1 310.62
## habitat 2 309.23
## sin.dist.21.June 1 313.01
## cos.dist.21.June 1 318.05
## sin.dist.noon 1 316.93
## cos.dist.noon 1 315.58
We can drop the habitat altogether, but before we so, let’s compare the p-values of comparing the habitats to each other:
EMM <- emmeans(object = loess.sp.rich.model1, ~habitat + year.count)
test_results_land_use <- test(pairs(EMM, by = 'year.count'), by = NULL, adjust="fdr")
print(test_results_land_use)
## contrast year.count estimate SE df z.ratio
## bedouin agriculture - kkl plantings 2.98 -0.1448 0.216 Inf -0.670
## bedouin agriculture - loess 2.98 -0.2329 0.236 Inf -0.985
## kkl plantings - loess 2.98 -0.0881 0.198 Inf -0.444
## p.value
## 0.6572
## 0.6572
## 0.6572
##
## Results are given on the log (not the response) scale.
## P value adjustment: fdr method for 3 tests
capture.output(test_results_land_use, file = 'Output/Loess compare habitats - reptile species richness.txt') # Export the results
And now let’s proceed to dropping the habitat from the model:
loess.sp.rich.model2 <- glmmTMB(species.richness ~ year.count + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'poisson', data = loess)
summary(loess.sp.rich.model2)
## Family: poisson ( log )
## Formula:
## species.richness ~ year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 309.2 328.3 -147.6 295.2 105
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.0008169 0.02858
## Number of obs: 112, groups: site, 7
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.51728 0.72933 2.080 0.03749 *
## year.count -0.03359 0.04141 -0.811 0.41719
## sin.dist.21.June 0.50367 0.36413 1.383 0.16660
## cos.dist.21.June -2.10546 0.77047 -2.733 0.00628 **
## sin.dist.noon 0.63303 0.20420 3.100 0.00194 **
## cos.dist.noon 1.01817 0.48928 2.081 0.03744 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(loess.sp.rich.model2)
## Single term deletions
##
## Model:
## species.richness ~ year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 309.23
## year.count 1 307.89
## sin.dist.21.June 1 309.14
## cos.dist.21.June 1 314.11
## sin.dist.noon 1 317.02
## cos.dist.noon 1 312.06
We can also drop the trend:
loess.sp.rich.model3 <- glmmTMB(species.richness ~ sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'poisson', data = loess)
summary(loess.sp.rich.model3)
## Family: poisson ( log )
## Formula:
## species.richness ~ sin.dist.21.June + cos.dist.21.June + sin.dist.noon +
## cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 307.9 324.2 -147.9 295.9 106
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.002592 0.05092
## Number of obs: 112, groups: site, 7
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.4704 0.7332 2.005 0.04492 *
## sin.dist.21.June 0.6131 0.3471 1.766 0.07734 .
## cos.dist.21.June -2.1919 0.7699 -2.847 0.00441 **
## sin.dist.noon 0.6163 0.2054 3.000 0.00270 **
## cos.dist.noon 1.0802 0.4813 2.244 0.02482 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(loess.sp.rich.model3)
## Single term deletions
##
## Model:
## species.richness ~ sin.dist.21.June + cos.dist.21.June + sin.dist.noon +
## cos.dist.noon + (1 | site)
## Df AIC
## <none> 307.89
## sin.dist.21.June 1 309.06
## cos.dist.21.June 1 313.56
## sin.dist.noon 1 315.16
## cos.dist.noon 1 311.62
We can drop sine seasonality since delta AIC < 2:
loess.sp.rich.model4 <- glmmTMB(species.richness ~ cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1|site), family = 'poisson', data = loess)
summary(loess.sp.rich.model4)
## Family: poisson ( log )
## Formula:
## species.richness ~ cos.dist.21.June + sin.dist.noon + cos.dist.noon +
## (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 309.1 322.6 -149.5 299.1 107
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.002083 0.04563
## Number of obs: 112, groups: site, 7
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.5068 0.5089 0.996 0.31931
## cos.dist.21.June -1.1444 0.5094 -2.247 0.02466 *
## sin.dist.noon 0.5915 0.1962 3.014 0.00258 **
## cos.dist.noon 0.9721 0.4671 2.081 0.03743 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(loess.sp.rich.model4)
## Single term deletions
##
## Model:
## species.richness ~ cos.dist.21.June + sin.dist.noon + cos.dist.noon +
## (1 | site)
## Df AIC
## <none> 309.06
## cos.dist.21.June 1 311.79
## sin.dist.noon 1 316.31
## cos.dist.noon 1 311.90
No more predictors to drop. Let’s proceed to model diagnostics:
# The chosen model is loess.sp.rich.model4 (time of day and season)
loess.sp.rich.sim.res <- simulateResiduals(loess.sp.rich.model4) # simulate the residuals using DHARMa package for model diagnostics
plot(loess.sp.rich.sim.res) # The QQ plot is not good ; dispersion is significant; residual quantile test is significant
plotResiduals(loess.sp.rich.sim.res, form = loess$cos.dist.21.June) # Quantile deviations detected for cosine seasonality
plotResiduals(loess.sp.rich.sim.res, form = loess$cos.dist.noon) # Quantile deviations detected for cosine diel pattern
plotResiduals(loess.sp.rich.sim.res, form = loess$sin.dist.noon)# Quantile deviations detected for sine diel pattern
testDispersion(loess.sp.rich.sim.res, alternative = 'greater') # p-value = 1, no over-dispersion
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.54749, p-value = 1
## alternative hypothesis: greater
testDispersion(loess.sp.rich.sim.res, alternative = 'less', plot = F) # p < 2.2e-16 -> under-dispersion
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.54749, p-value < 2.2e-16
## alternative hypothesis: less
testDispersion(loess.sp.rich.sim.res, alternative = 'greater') # p = 1, suggesting under-dispersion
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.54749, p-value = 1
## alternative hypothesis: greater
testDispersion(loess.sp.rich.sim.res, alternative = 'less', plot = F) # p < 2.2e-16 -> under-dispersion, small power
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.54749, p-value < 2.2e-16
## alternative hypothesis: less
plot(loess.sp.rich.sim.res$fittedPredictedResponse, loess.sp.rich.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nLoess species richness model 4')
plot(fitted(loess.sp.rich.model4), residuals(loess.sp.rich.model4), main = 'Response scale residuals\nLoess species richness model 4')
# Export these graphs:
png('Analysis/Model diagnostics/Loess species richness model 4 QQ Plot.png')
plot(loess.sp.rich.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Loess species richness model 4 fitted vs. scaled residuals.png')
plot(loess.sp.rich.sim.res$fittedPredictedResponse, loess.sp.rich.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nLoess species richness model 4')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Loess species richness model 4 fitted vs. residuals.png')
plot(fitted(loess.sp.rich.model4), residuals(loess.sp.rich.model4), main = 'Response scale residuals\nLoess species richness model 4')
dev.off()
## png
## 2
We can see clear indications of under-dispersion because the results of the testDispersion functions with the alternative of lower dispersion are highly significant. This means we have lower statistical power (increased type II error rate). In addition we see that there are some over-predictions for the seasonal and diel predictors. However, as none of the research hypotheses predictors were included in the final model, we will not try to predict species richness in the Loess anyway. Back up all the Loess species richness models and document the model selection process:
file.remove('Analysis/Loess - species richness model selection.txt')
## [1] TRUE
for (model in c(ls()[grep('*loess.sp.rich.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/Loess - species richness model selection.txt', append = T)
}
# load('Analysis/Inner sands - Species richness models.Rdata')
save(list = ls()[grep('*loess.sp.rich.model', ls())], file = 'Analysis/Inner sands - Species richness models.Rdata')
capture.output(cat('The best fitting model for species richness in the loess is loess.sp.rich.model4.'),
summary(loess.sp.rich.model4), file = 'Output/Loess species richness - best fitting model.txt', append = F)
# Create a table comparing total abundance models:
for(model in ls()[grep('*loess.sp.rich.model.', ls())]){
sp.rich.comparison <- rbind(sp.rich.comparison,
data.table(unit = 'Loess', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
sp.rich.comparison <- sp.rich.comparison[!(formula %like% '~' | formula %like% 'species.richness')] # remove redundant rows
sp.rich.comparison <- unique(sp.rich.comparison)
setorder(sp.rich.comparison, unit, AIC) # Sort by AIC (ascending)
sp.rich.comparison[unit == 'Loess', .(model, family, no.of.preds, AIC, BIC)] # View the table
## model family no.of.preds AIC BIC
## 1: loess.sp.rich.model3 poisson 4 307.8939 324.2049
## 2: loess.sp.rich.model4 poisson 3 309.0570 322.6495
## 3: loess.sp.rich.model2 poisson 5 309.2320 328.2615
## 4: loess.sp.rich.model1 poisson 6 312.2518 336.7183
## 5: loess.sp.rich.model.full.Poisson poisson 7 314.2599 344.1634
write_excel_csv(sp.rich.comparison, file = 'Analysis/Species richness models of reptiles - AIC comparison.csv')
rm(list = setdiff(ls()[grep('*loess.sp.rich.model', ls())], c('loess.sp.rich.model4'))) # Clean up
Again, we find no researcher hypotheses in the chosen model, so we do not explore its predictions. Move on to total reptile abundance. Let’s start with data visualization:
ggplot(data = loess, aes(x = habitat, y = total.abundance, color = habitat)) + geom_boxplot() + facet_wrap(. ~ year)
2018-2020 seem lower than 2014-2016, but not in KKL (JNF) plantations.
Let’s examine the histogram of the total abundance of all Loess
surveys:
loess[, .(no.of.surveys = uniqueN(survey_ID)), keyby = total.abundance]
## total.abundance no.of.surveys
## 1: 0 15
## 2: 1 29
## 3: 2 32
## 4: 3 9
## 5: 4 10
## 6: 5 5
## 7: 6 4
## 8: 7 2
## 9: 8 2
## 10: 9 2
## 11: 12 1
## 12: 14 1
ggplot(loess[, .(no.of.surveys = uniqueN(survey_ID)), keyby = total.abundance], aes(x = total.abundance, y = no.of.surveys)) + geom_col()
The distribution is obviously skewed, with many low (0-2) values. Let’s
see when the surveys were taken, both in season and in the time of day.
First, view the season of the survey:
loess[, .(no.of.surveys = uniqueN(survey_ID)), keyby = month(Date)] # From April to July, mostly in June
## month no.of.surveys
## 1: 4 10
## 2: 5 31
## 3: 6 49
## 4: 7 22
ggplot(loess[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(calendar.Date = as.Date(yday(Date)-1))], aes(x = calendar.Date, y = no.of.surveys)) + geom_col() + scale_x_date(date_labels = '%d/%m')
While surveys where conducted from April to July, most surveys were
conducted in mid-late June (around June 20th). Let’s see the
distribution of times in the day:
reptiles[unit %like% 'Loess', .(no.of.surveys = uniqueN(survey_ID)), keyby = round(ITime)] # From 7:00 to 18:00, mostly in 10:00-12:00
## round no.of.surveys
## 1: 07:00:00 3
## 2: 08:00:00 3
## 3: 09:00:00 9
## 4: 10:00:00 23
## 5: 11:00:00 14
## 6: 12:00:00 21
## 7: 13:00:00 13
## 8: 14:00:00 8
## 9: 15:00:00 8
## 10: 16:00:00 6
## 11: 17:00:00 3
## 12: 18:00:00 1
ggplot(reptiles[unit %like% 'Loess', .(no.of.surveys = uniqueN(survey_ID)), keyby = .(Time = as.POSIXct(round(ITime)))], aes(x = Time, y = no.of.surveys)) + geom_col() + scale_x_datetime(date_labels = '%H:%M', date_breaks = '1 hour')
While surveys were conducted from 7:00 to 18:00, most of them were
conducted in 10:00 to 12:00. Let’s proceed to model selection:
# Full model, Poisson response
loess.abnd.model.full.Poisson <- glmmTMB(total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'poisson', data = loess)
summary(loess.abnd.model.full.Poisson) # AIC = 440.2 BIC = 470.1. Trend-habitat interactions are significant
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 440.2 470.1 -209.1 418.2 101
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.01998 0.1414
## Number of obs: 112, groups: site, 7
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 3.37729 0.66780 5.057 4.25e-07 ***
## year.count -0.25511 0.06613 -3.858 0.000114 ***
## habitatkkl plantings -0.96863 0.28199 -3.435 0.000593 ***
## habitatloess -0.12713 0.27252 -0.466 0.640861
## sin.dist.21.June 1.03156 0.33372 3.091 0.001994 **
## cos.dist.21.June -2.64180 0.70493 -3.748 0.000179 ***
## sin.dist.noon 0.47348 0.16469 2.875 0.004040 **
## cos.dist.noon 0.77682 0.38156 2.036 0.041761 *
## year.count:habitatkkl plantings 0.29139 0.08417 3.462 0.000536 ***
## year.count:habitatloess 0.13216 0.07856 1.682 0.092515 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat('PHI = '); deviance(loess.abnd.model.full.Poisson)/df.residual(loess.abnd.model.full.Poisson)
## PHI =
## [1] 1.441331
drop1(loess.abnd.model.full.Poisson)
## Single term deletions
##
## Model:
## total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 440.25
## sin.dist.21.June 1 447.18
## cos.dist.21.June 1 451.26
## sin.dist.noon 1 446.78
## cos.dist.noon 1 442.66
## year.count:habitat 2 449.08
This time PHI > 1, so we should try a negative binomial model as well.
# Full model, Negative Binomial response
loess.abnd.model.full.NB <- glmmTMB(total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'nbinom2', data = loess)
summary(loess.abnd.model.full.NB)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 434.6 467.2 -205.3 410.6 100
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.008345 0.09135
## Number of obs: 112, groups: site, 7
##
## Dispersion parameter for nbinom2 family (): 6.96
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 3.21202 0.75734 4.241 2.22e-05 ***
## year.count -0.24626 0.07228 -3.407 0.000657 ***
## habitatkkl plantings -0.97959 0.32220 -3.040 0.002363 **
## habitatloess -0.05256 0.30863 -0.170 0.864766
## sin.dist.21.June 1.06090 0.38558 2.751 0.005934 **
## cos.dist.21.June -2.67408 0.80611 -3.317 0.000909 ***
## sin.dist.noon 0.45723 0.19317 2.367 0.017931 *
## cos.dist.noon 0.96736 0.44740 2.162 0.030606 *
## year.count:habitatkkl plantings 0.29429 0.09379 3.138 0.001702 **
## year.count:habitatloess 0.13019 0.08796 1.480 0.138828
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(loess.abnd.model.full.NB)
## Single term deletions
##
## Model:
## total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 434.61
## sin.dist.21.June 1 439.72
## cos.dist.21.June 1 442.85
## sin.dist.noon 1 438.16
## cos.dist.noon 1 437.64
## year.count:habitat 2 440.69
Apparently, we cannot drop any predictors to decrease AIC, but we will try to do so anyway. Let’s start by dropping the interaction:
loess.abnd.model1 <- glmmTMB(total.abundance ~ year.count + habitat + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'nbinom2', data = loess)
summary(loess.abnd.model1)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count + habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 440.7 467.9 -210.3 420.7 102
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.01509 0.1228
## Number of obs: 112, groups: site, 7
##
## Dispersion parameter for nbinom2 family (): 5.53
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.88646 0.74326 3.883 0.000103 ***
## year.count -0.10408 0.04049 -2.571 0.010154 *
## habitatkkl plantings -0.22327 0.22421 -0.996 0.319348
## habitatloess 0.19676 0.25082 0.784 0.432779
## sin.dist.21.June 1.03668 0.40476 2.561 0.010431 *
## cos.dist.21.June -2.44195 0.81388 -3.000 0.002696 **
## sin.dist.noon 0.44637 0.19386 2.303 0.021304 *
## cos.dist.noon 0.73928 0.44003 1.680 0.092942 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(loess.abnd.model1)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 440.69
## year.count 1 445.19
## habitat 2 440.65
## sin.dist.21.June 1 444.97
## cos.dist.21.June 1 447.25
## sin.dist.noon 1 443.94
## cos.dist.noon 1 441.65
Proceed to dropping the habitat:
loess.abnd.model2 <- glmmTMB(total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'nbinom2', data = loess)
summary(loess.abnd.model2)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 440.6 462.4 -212.3 424.6 104
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.034 0.1844
## Number of obs: 112, groups: site, 7
##
## Dispersion parameter for nbinom2 family (): 5.27
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 3.03277 0.76815 3.948 7.88e-05 ***
## year.count -0.10526 0.04085 -2.577 0.00997 **
## sin.dist.21.June 1.05036 0.39873 2.634 0.00843 **
## cos.dist.21.June -2.43741 0.82876 -2.941 0.00327 **
## sin.dist.noon 0.47525 0.18369 2.587 0.00968 **
## cos.dist.noon 0.57006 0.43498 1.311 0.19001
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(loess.abnd.model2)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 440.65
## year.count 1 445.22
## sin.dist.21.June 1 445.44
## cos.dist.21.June 1 447.02
## sin.dist.noon 1 445.13
## cos.dist.noon 1 440.44
We can drop cosine diel pattern:
loess.abnd.model3 <- glmmTMB(total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + (1|site), family = 'nbinom2', data = loess)
summary(loess.abnd.model3)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 440.4 459.5 -213.2 426.4 105
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.02756 0.166
## Number of obs: 112, groups: site, 7
##
## Dispersion parameter for nbinom2 family (): 5.25
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 3.24730 0.74267 4.372 1.23e-05 ***
## year.count -0.11255 0.04034 -2.790 0.00527 **
## sin.dist.21.June 0.96440 0.38865 2.481 0.01309 *
## cos.dist.21.June -2.13790 0.78662 -2.718 0.00657 **
## sin.dist.noon 0.45975 0.17886 2.570 0.01016 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(loess.abnd.model3)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Df AIC
## <none> 440.44
## year.count 1 446.12
## sin.dist.21.June 1 444.41
## cos.dist.21.June 1 445.44
## sin.dist.noon 1 444.80
No more predictors to drop, and the full model is still preferable according to AIC. At least we tried! Let’s proceed to model diagnostics:
# The chosen model is the full negative binomial model....
summary(loess.abnd.model.full.NB)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 434.6 467.2 -205.3 410.6 100
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.008345 0.09135
## Number of obs: 112, groups: site, 7
##
## Dispersion parameter for nbinom2 family (): 6.96
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 3.21202 0.75734 4.241 2.22e-05 ***
## year.count -0.24626 0.07228 -3.407 0.000657 ***
## habitatkkl plantings -0.97959 0.32220 -3.040 0.002363 **
## habitatloess -0.05256 0.30863 -0.170 0.864766
## sin.dist.21.June 1.06090 0.38558 2.751 0.005934 **
## cos.dist.21.June -2.67408 0.80611 -3.317 0.000909 ***
## sin.dist.noon 0.45723 0.19317 2.367 0.017931 *
## cos.dist.noon 0.96736 0.44740 2.162 0.030606 *
## year.count:habitatkkl plantings 0.29429 0.09379 3.138 0.001702 **
## year.count:habitatloess 0.13019 0.08796 1.480 0.138828
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
loess.abnd.sim.res <- simulateResiduals(loess.abnd.model.full.NB)
plot(loess.abnd.sim.res) # No problems detected in the QQ plot
plot(loess.abnd.sim.res$fittedPredictedResponse, loess.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nLoess total abundance model 4')
plot(fitted(loess.abnd.model.full.NB), residuals(loess.abnd.model.full.NB), main = 'Response scale residuals\nLoess total abundance model 4')
# Export these graphs:
png('Analysis/Model diagnostics/Loess total abundance model 4 QQ Plot.png')
plot(loess.abnd.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Loess total abundance model 4 fitted vs. scaled residuals.png')
plot(loess.abnd.sim.res$fittedPredictedResponse, loess.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nLoess total abundance model 4')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Loess total abundance model 4 fitted vs. residuals.png')
plot(fitted(loess.abnd.model.full.NB), residuals(loess.abnd.model.full.NB), main = 'Response scale residuals\nLoess total abundance model 4')
dev.off()
## png
## 2
Back up and document all the Loess total abundance models:
file.remove('Analysis/Loess - total abundance model selection.txt')
## [1] TRUE
for (model in c(ls()[grep('*loess.sp.rich.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/Loess - total abundance model selection.txt', append = T)
}
# load('Analysis/Inner sands - total abundance models.Rdata')
save(list = ls()[grep('*loess.abnd.model', ls())], file = 'Analysis/Loess - total abundance models.Rdata')
capture.output(cat('The best fitting model for total abundance in the loess is loess.abnd.model.full.NB.'),
summary(loess.abnd.model.full.NB), file = 'Output/Loess total abundance - best fitting model.txt', append = F)
# Create a table comparing total abundance models:
for(model in ls()[grep('*loess.abnd.model.', ls())]){
total.abnd.comparison <- rbind(total.abnd.comparison,
data.table(unit = 'Loess', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
total.abnd.comparison <- total.abnd.comparison[!(formula %like% '~' | formula %like% 'total.abundance')] # remove redundant rows
total.abnd.comparison <- unique(total.abnd.comparison)
setorder(total.abnd.comparison, unit, AIC) # Sort by AIC (ascending)
total.abnd.comparison[unit == 'Loess', .(model, family, formula, no.of.preds, AIC, BIC)] # View the table
## model family
## 1: loess.abnd.model.full.NB nbinom2
## 2: loess.abnd.model.full.Poisson poisson
## 3: loess.abnd.model3 nbinom2
## 4: loess.abnd.model2 nbinom2
## 5: loess.abnd.model1 nbinom2
## formula
## 1: year.count * habitat + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## 2: year.count * habitat + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## 3: year.count + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + (1 | site)
## 4: year.count + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## 5: year.count + habitat + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## no.of.preds AIC BIC
## 1: 7 434.6130 467.2350
## 2: 7 440.2454 470.1489
## 3: 4 440.4351 459.4646
## 4: 5 440.6480 462.3960
## 5: 6 440.6873 467.8723
write_excel_csv(total.abnd.comparison, file = 'Analysis/Total abundance models of reptiles - AIC comparison.csv')
rm(list = setdiff(ls()[grep('*loess.abnd.model', ls())], c('loess.abnd.model.full.NB'))) # Clean up
This time we have surprisingly accepted the full model. Let’s see what are the trends in each land use:
EMM_year_count <- emtrends(object = loess.abnd.model.full.NB, specs = 'habitat', var = 'year.count', type = 'response')
test_results_land_use <- test(EMM_year_count, null = 0, adjust="fdr")
print(test_results_land_use)
## habitat year.count.trend SE df z.ratio p.value
## bedouin agriculture -0.246 0.0723 Inf -3.407 0.0020
## kkl plantings 0.048 0.0671 Inf 0.716 0.4738
## loess -0.116 0.0557 Inf -2.085 0.0556
##
## P value adjustment: fdr method for 3 tests
capture.output(test_results_land_use, file = 'Output/Loess habitat trends - reptile abundance.txt') # Export the results
So, this mean that there is a significant (p = 0.0020) negative trend in the bedouin agriculture, but no significant trend in KKL plantings or the natural loess. Now let’s proceed to examining the statistical significance of the overall trend (giving equal weight to each land use category):
test_results_year_ct_overall <- contrast(object = EMM_year_count, method = list(mean_trend = c(1/3, 1/3, 1/3)))
print(test_results_year_ct_overall)
## contrast estimate SE df z.ratio p.value
## mean_trend -0.105 0.0406 Inf -2.579 0.0099
This means there is an overall significant negative trend in reptile abundance (p = 0.0099). Next, let’s see if there are significant differences between habitats (land uses):
EMM <- emmeans(object = loess.abnd.model.full.NB, ~habitat * year.count)
test_results_land_use <- test(pairs(EMM, by = 'year.count'), by = NULL, adjust="fdr")
print(test_results_land_use)
## contrast year.count estimate SE df z.ratio
## bedouin agriculture - kkl plantings 2.98 0.102 0.219 Inf 0.466
## bedouin agriculture - loess 2.98 -0.336 0.243 Inf -1.379
## kkl plantings - loess 2.98 -0.438 0.203 Inf -2.156
## p.value
## 0.6413
## 0.2520
## 0.0934
##
## Results are given on the log (not the response) scale.
## P value adjustment: fdr method for 3 tests
capture.output(test_results_land_use, file = 'Output/Loess compare habitats - reptile abundance.txt') # Export the results
We found no significant differences in total reptile abundance between habitats (p > 0.05 for all comparisons). Now let’s explore the model’s predictions:
# Loess - predict reptile total abundance----
summary(loess.abnd.model.full.NB)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 434.6 467.2 -205.3 410.6 100
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.008345 0.09135
## Number of obs: 112, groups: site, 7
##
## Dispersion parameter for nbinom2 family (): 6.96
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 3.21202 0.75734 4.241 2.22e-05 ***
## year.count -0.24626 0.07228 -3.407 0.000657 ***
## habitatkkl plantings -0.97959 0.32220 -3.040 0.002363 **
## habitatloess -0.05256 0.30863 -0.170 0.864766
## sin.dist.21.June 1.06090 0.38558 2.751 0.005934 **
## cos.dist.21.June -2.67408 0.80611 -3.317 0.000909 ***
## sin.dist.noon 0.45723 0.19317 2.367 0.017931 *
## cos.dist.noon 0.96736 0.44740 2.162 0.030606 *
## year.count:habitatkkl plantings 0.29429 0.09379 3.138 0.001702 **
## year.count:habitatloess 0.13019 0.08796 1.480 0.138828
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Predict by the mean observed values of date and time of day
loess[, sort(unique(unit))]
## [1] Loess Covered Areas in the Northern Negev
## 5 Levels: Coastal Plain Sands ... Planted Conifer Forests
# Create a table to be filled by a loop with predictor values to be used for predictions
loess[, sort(unique(year))] # 2014-2020
## [1] 2014 2016 2018 2020
# Plot the model's diel pattern
loess.total.abnd.diel.pred <- data.table(expand.grid(Date = as.Date(c('2014-07-20', '2016-07-20', '2018-07-20', '2020-07-20')),
site = NA, habitat = loess[, unique(habitat)],
ITime = seq(as.ITime('00:00'), as.ITime('23:30'), by = 1800)))
loess.total.abnd.diel.pred[, ':=' (Date.time = as.POSIXct(paste(Date, ITime, tz = 'Asia/Jerusalem')))]
loess.total.abnd.diel.pred[, .(Date, ITime, Date.time)] # seems ok
## Date ITime Date.time
## 1: 2014-07-20 00:00:00 2014-07-20 00:00:00
## 2: 2016-07-20 00:00:00 2016-07-20 00:00:00
## 3: 2018-07-20 00:00:00 2018-07-20 00:00:00
## 4: 2020-07-20 00:00:00 2020-07-20 00:00:00
## 5: 2014-07-20 00:00:00 2014-07-20 00:00:00
## ---
## 572: 2020-07-20 23:30:00 2020-07-20 23:30:00
## 573: 2014-07-20 23:30:00 2014-07-20 23:30:00
## 574: 2016-07-20 23:30:00 2016-07-20 23:30:00
## 575: 2018-07-20 23:30:00 2018-07-20 23:30:00
## 576: 2020-07-20 23:30:00 2020-07-20 23:30:00
loess.total.abnd.diel.pred[, ':=' (dist.21.June = ifelse(yday(Date) < 354,
Date - as.Date(paste(year(Date), 6, 21, sep = '-')),
Date - as.Date(paste(year(Date) + 1, 6, 21, sep = '-'))),
dist.noon = ifelse(as.ITime(ITime) < as.ITime('12:00'), # If the starting hour is before noon...
Date.time %--% as.POSIXct(paste(Date, '12:00:00'), tz = 'Asia/Jerusalem'), # ...then take the distance from today's noon
Date.time %--% as.POSIXct(paste(Date , '12:00:00'), tz = 'Asia/Jerusalem')))] # else, take the distance from tomorrow's noon
loess.total.abnd.diel.pred[, ':=' (year = year(Date),
dist.21.June.radians = dist.21.June * pi / 182.5, # Convert to radians (multiply by pi and divide by half the number of days in a year), one harmonic
dist.21.June.radians.2h = 2*dist.21.June * pi / 182.5,
dist.noon.radians = dist.noon * pi/(12*60*60))] # convert to radians (multiply by pi and divide by half the number of seconds in a day), one harmonic
setorder(loess.total.abnd.diel.pred, Date, dist.21.June.radians, dist.noon.radians)
# View(loess.total.abnd.diel.pred) # seems ok
loess.total.abnd.diel.pred[, ':=' (year.count = year - min(year),
sin.dist.21.June = sin(dist.21.June.radians), cos.dist.21.June = cos(dist.21.June.radians),
sin.dist.noon = sin(dist.noon.radians), cos.dist.noon = cos(dist.noon.radians))] # Calculate the sin and cosine of the distance from June 21st
loess.total.abnd.diel.pred
## Date site habitat ITime Date.time
## 1: 2014-07-20 NA bedouin agriculture 23:30:00 2014-07-20 23:30:00
## 2: 2014-07-20 NA kkl plantings 23:30:00 2014-07-20 23:30:00
## 3: 2014-07-20 NA loess 23:30:00 2014-07-20 23:30:00
## 4: 2014-07-20 NA bedouin agriculture 23:00:00 2014-07-20 23:00:00
## 5: 2014-07-20 NA kkl plantings 23:00:00 2014-07-20 23:00:00
## ---
## 572: 2020-07-20 NA kkl plantings 00:30:00 2020-07-20 00:30:00
## 573: 2020-07-20 NA loess 00:30:00 2020-07-20 00:30:00
## 574: 2020-07-20 NA bedouin agriculture 00:00:00 2020-07-20 00:00:00
## 575: 2020-07-20 NA kkl plantings 00:00:00 2020-07-20 00:00:00
## 576: 2020-07-20 NA loess 00:00:00 2020-07-20 00:00:00
## dist.21.June dist.noon year dist.21.June.radians dist.21.June.radians.2h
## 1: 29 -41400 2014 0.499212 0.998424
## 2: 29 -41400 2014 0.499212 0.998424
## 3: 29 -41400 2014 0.499212 0.998424
## 4: 29 -39600 2014 0.499212 0.998424
## 5: 29 -39600 2014 0.499212 0.998424
## ---
## 572: 29 41400 2020 0.499212 0.998424
## 573: 29 41400 2020 0.499212 0.998424
## 574: 29 43200 2020 0.499212 0.998424
## 575: 29 43200 2020 0.499212 0.998424
## 576: 29 43200 2020 0.499212 0.998424
## dist.noon.radians year.count sin.dist.21.June cos.dist.21.June
## 1: -3.010693 0 0.4787338 0.8779601
## 2: -3.010693 0 0.4787338 0.8779601
## 3: -3.010693 0 0.4787338 0.8779601
## 4: -2.879793 0 0.4787338 0.8779601
## 5: -2.879793 0 0.4787338 0.8779601
## ---
## 572: 3.010693 6 0.4787338 0.8779601
## 573: 3.010693 6 0.4787338 0.8779601
## 574: 3.141593 6 0.4787338 0.8779601
## 575: 3.141593 6 0.4787338 0.8779601
## 576: 3.141593 6 0.4787338 0.8779601
## sin.dist.noon cos.dist.noon
## 1: -1.305262e-01 -0.9914449
## 2: -1.305262e-01 -0.9914449
## 3: -1.305262e-01 -0.9914449
## 4: -2.588190e-01 -0.9659258
## 5: -2.588190e-01 -0.9659258
## ---
## 572: 1.305262e-01 -0.9914449
## 573: 1.305262e-01 -0.9914449
## 574: -3.216286e-16 -1.0000000
## 575: -3.216286e-16 -1.0000000
## 576: -3.216286e-16 -1.0000000
plot(loess.total.abnd.diel.pred[year == 2014, ITime], loess.total.abnd.diel.pred[year == 2014,sin.dist.noon],
main = 'Sine of distance to noon') # sanity check - should be a wave
plot(loess.total.abnd.diel.pred[year == 2014, ITime], loess.total.abnd.diel.pred[year == 2014, cos.dist.noon],
main = 'Cosine of distance to noon') # sanity check - should be a wave
bla <- predict(loess.abnd.model.full.NB, newdata = loess.total.abnd.diel.pred, type = 'response', se.fit = T)
loess.total.abnd.diel.pred[, ':=' (predicted.abnd = bla$fit, predicted.abnd.se = bla$se.fit)]
# loess.total.abnd.diel.pred[, .(year, predicted.abnd, predicted.abnd.se)] # From 12.1 in 2017 to 5.7 individuals in 2021 in both habitats
loess.total.abnd.diel.pred
## Date site habitat ITime Date.time
## 1: 2014-07-20 NA bedouin agriculture 23:30:00 2014-07-20 23:30:00
## 2: 2014-07-20 NA kkl plantings 23:30:00 2014-07-20 23:30:00
## 3: 2014-07-20 NA loess 23:30:00 2014-07-20 23:30:00
## 4: 2014-07-20 NA bedouin agriculture 23:00:00 2014-07-20 23:00:00
## 5: 2014-07-20 NA kkl plantings 23:00:00 2014-07-20 23:00:00
## ---
## 572: 2020-07-20 NA kkl plantings 00:30:00 2020-07-20 00:30:00
## 573: 2020-07-20 NA loess 00:30:00 2020-07-20 00:30:00
## 574: 2020-07-20 NA bedouin agriculture 00:00:00 2020-07-20 00:00:00
## 575: 2020-07-20 NA kkl plantings 00:00:00 2020-07-20 00:00:00
## 576: 2020-07-20 NA loess 00:00:00 2020-07-20 00:00:00
## dist.21.June dist.noon year dist.21.June.radians dist.21.June.radians.2h
## 1: 29 -41400 2014 0.499212 0.998424
## 2: 29 -41400 2014 0.499212 0.998424
## 3: 29 -41400 2014 0.499212 0.998424
## 4: 29 -39600 2014 0.499212 0.998424
## 5: 29 -39600 2014 0.499212 0.998424
## ---
## 572: 29 41400 2020 0.499212 0.998424
## 573: 29 41400 2020 0.499212 0.998424
## 574: 29 43200 2020 0.499212 0.998424
## 575: 29 43200 2020 0.499212 0.998424
## 576: 29 43200 2020 0.499212 0.998424
## dist.noon.radians year.count sin.dist.21.June cos.dist.21.June
## 1: -3.010693 0 0.4787338 0.8779601
## 2: -3.010693 0 0.4787338 0.8779601
## 3: -3.010693 0 0.4787338 0.8779601
## 4: -2.879793 0 0.4787338 0.8779601
## 5: -2.879793 0 0.4787338 0.8779601
## ---
## 572: 3.010693 6 0.4787338 0.8779601
## 573: 3.010693 6 0.4787338 0.8779601
## 574: 3.141593 6 0.4787338 0.8779601
## 575: 3.141593 6 0.4787338 0.8779601
## 576: 3.141593 6 0.4787338 0.8779601
## sin.dist.noon cos.dist.noon predicted.abnd predicted.abnd.se
## 1: -1.305262e-01 -0.9914449 1.4239030 1.1724847
## 2: -1.305262e-01 -0.9914449 0.5346275 0.4814585
## 3: -1.305262e-01 -0.9914449 1.3509915 1.1010336
## 4: -2.588190e-01 -0.9659258 1.3763408 1.1207262
## 5: -2.588190e-01 -0.9659258 0.5167695 0.4617604
## ---
## 572: 1.305262e-01 -0.9914449 0.8036328 0.6768585
## 573: 1.305262e-01 -0.9914449 0.7586610 0.6365878
## 574: -3.216286e-16 -1.0000000 0.3420709 0.3063937
## 575: -3.216286e-16 -1.0000000 0.7508350 0.6381983
## 576: -3.216286e-16 -1.0000000 0.7088178 0.6000008
# plot the diel predictions
ggplot(data = loess.total.abnd.diel.pred, aes(x = as.POSIXct(ITime), y = predicted.abnd, color = habitat)) + geom_line() +
geom_point(data = reptiles[unit %like% 'Loess', .(total.abnd = sum(count_individuals, na.rm = T)),
keyby = .(habitat, survey_ID, year(Date), ITime, as.POSIXct(paste(paste(2017, month(Date), mday(Date), sep = '-'), ITime),
tz = 'Asia/Jerusalem'))],
aes(x = as.POSIXct(ITime), y = total.abnd, color = habitat)) + labs(x = 'Time', y = 'Abundance', title = 'Loess Reptiles',
subtitle = 'Predicted abundance for July 20th\nObserved abundance for all actual survey dates') + theme_bw() +
facet_wrap(. ~ year) + theme(axis.text = element_text(size = 8)) +
scale_x_datetime(date_labels = '%H:%M', date_breaks = '3 hours')
ggsave('Analysis/loess.total.abnd.model3 diel Predictions and observations in reptile total abundance.png', scale = 1.25)
## Saving 8.75 x 6.25 in image
The predictions are more or less in line the observations; peak time is around 10:30-11:00. Let’s proceed to predicting the trend, for a fixed calendar date (July 20th) and a fixed time of day (10:30 a.m.):
summary(loess.abnd.model.full.NB)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count * habitat + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: loess
##
## AIC BIC logLik deviance df.resid
## 434.6 467.2 -205.3 410.6 100
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.008345 0.09135
## Number of obs: 112, groups: site, 7
##
## Dispersion parameter for nbinom2 family (): 6.96
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 3.21202 0.75734 4.241 2.22e-05 ***
## year.count -0.24626 0.07228 -3.407 0.000657 ***
## habitatkkl plantings -0.97959 0.32220 -3.040 0.002363 **
## habitatloess -0.05256 0.30863 -0.170 0.864766
## sin.dist.21.June 1.06090 0.38558 2.751 0.005934 **
## cos.dist.21.June -2.67408 0.80611 -3.317 0.000909 ***
## sin.dist.noon 0.45723 0.19317 2.367 0.017931 *
## cos.dist.noon 0.96736 0.44740 2.162 0.030606 *
## year.count:habitatkkl plantings 0.29429 0.09379 3.138 0.001702 **
## year.count:habitatloess 0.13019 0.08796 1.480 0.138828
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
loess.total.abnd.fit.data <- data.table(expand.grid(Date = as.Date(c('2014-07-20', '2015-07-20', '2016-07-20', '2017-07-20', '2018-07-20', '2019-07-20', '2020-07-20')),
year = unique(c(2014, 2020, seq(from = 2014, to = 2020, by = 6/100))), site = NA, habitat = loess[, unique(habitat)],
ITime = as.ITime('10:30')))
loess.total.abnd.fit.data <- loess.total.abnd.fit.data[floor(year) == year(Date)]
# loess.total.abnd.fit.data <- data.table(expand.grid(Date = c(seq.Date(as.Date('2014-06-01'), as.Date('2014-07-31'), by = '1 week'),
# seq.Date(as.Date('2016-06-01'), as.Date('2016-07-31'), by = '1 week'),
# seq.Date(as.Date('2018-06-01'), as.Date('2018-07-31'), by = '1 week'),
# seq.Date(as.Date('2020-06-01'), as.Date('2020-07-31'), by = '1 week')),
# point_name = NA, site = NA, habitat = loess[, unique(habitat)],
# ITime = as.ITime('10:30')))
loess.total.abnd.fit.data[, ':=' (Date.time = as.POSIXct(paste(Date, ITime, tz = 'Asia/Jerusalem')))]
loess.total.abnd.fit.data[, .(Date, ITime, Date.time)] # seems ok
## Date ITime Date.time
## 1: 2014-07-20 10:30:00 2014-07-20 10:30:00
## 2: 2020-07-20 10:30:00 2020-07-20 10:30:00
## 3: 2014-07-20 10:30:00 2014-07-20 10:30:00
## 4: 2014-07-20 10:30:00 2014-07-20 10:30:00
## 5: 2014-07-20 10:30:00 2014-07-20 10:30:00
## ---
## 299: 2019-07-20 10:30:00 2019-07-20 10:30:00
## 300: 2019-07-20 10:30:00 2019-07-20 10:30:00
## 301: 2019-07-20 10:30:00 2019-07-20 10:30:00
## 302: 2019-07-20 10:30:00 2019-07-20 10:30:00
## 303: 2019-07-20 10:30:00 2019-07-20 10:30:00
loess.total.abnd.fit.data[, ':=' (dist.21.June = ifelse(yday(Date) < 354,
Date - as.Date(paste(year(Date), 6, 21, sep = '-')),
Date - as.Date(paste(year(Date) + 1, 6, 21, sep = '-'))),
dist.noon = ifelse(as.ITime(ITime) < as.ITime('12:00'), # If the starting hour is before noon...
Date.time %--% as.POSIXct(paste(Date, '12:00:00'), tz = 'Asia/Jerusalem'), # ...then take the distance from today's noon
Date.time %--% as.POSIXct(paste(Date , '12:00:00'), tz = 'Asia/Jerusalem')))] # else, take the distance from tomorrow's noon
loess.total.abnd.fit.data[, ':=' (dist.21.June.radians = dist.21.June * pi / 182.5, # Convert to radians (multiply by pi and divide by half the number of days in a year), one harmonic
dist.21.June.radians.2h = 2*dist.21.June * pi / 182.5,
dist.noon.radians = dist.noon * pi/(12*60*60))] # convert to radians (multiply by pi and divide by half the number of seconds in a day), one harmonic
loess.total.abnd.fit.data[, ':=' (year.count = year - min(year),
sin.dist.21.June = sin(dist.21.June.radians), cos.dist.21.June = cos(dist.21.June.radians),
sin.dist.noon = sin(dist.noon.radians), cos.dist.noon = cos(dist.noon.radians))]
bla <- predict(loess.abnd.model.full.NB, newdata = loess.total.abnd.fit.data, type = 'response', se.fit = T)
loess.total.abnd.fit.data[, ':=' (predicted.abnd = bla$fit, predicted.abnd.se = bla$se.fit)]
loess.total.abnd.fit.data[, .(mean.predicted.abnd = mean(predicted.abnd), mean.predicted.abnd.se = mean(predicted.abnd.se)), keyby = .(habitat, year)] # decline in bedouin agriculture and loess, increase in kkl plantings
## habitat year mean.predicted.abnd mean.predicted.abnd.se
## 1: bedouin agriculture 2014.00 11.482973 3.400702
## 2: bedouin agriculture 2014.06 11.314555 3.327548
## 3: bedouin agriculture 2014.12 11.148606 3.256363
## 4: bedouin agriculture 2014.18 10.985092 3.187111
## 5: bedouin agriculture 2014.24 10.823975 3.119753
## ---
## 299: loess 2019.76 5.583178 2.351831
## 300: loess 2019.82 5.544432 2.347634
## 301: loess 2019.88 5.505955 2.343464
## 302: loess 2019.94 5.467745 2.339321
## 303: loess 2020.00 5.429799 2.335200
write_excel_csv(loess.total.abnd.fit.data[, .(mean.predicted.abnd = mean(predicted.abnd), mean.predicted.abnd.se = mean(predicted.abnd.se)), keyby = .(habitat, year)],
'Output/Predicted total reptile abundance in the Loess model3.csv')
loess.total.abnd.fit.data[habitat == 'bedouin agriculture' & year == floor(year), .(predicted.abnd), keyby = .(habitat, year)] # As the trend is negative, we will compare the first year's value to the last year's value
## habitat year predicted.abnd
## 1: bedouin agriculture 2014 11.482973
## 2: bedouin agriculture 2017 5.485419
## 3: bedouin agriculture 2020 2.620386
cat('Percent decline in the Bedouin agriculture: ')
## Percent decline in the Bedouin agriculture:
1 - loess.total.abnd.fit.data[habitat == 'bedouin agriculture' & year == max(year), round(predicted.abnd, 1)] / loess.total.abnd.fit.data[habitat == 'bedouin agriculture' & year == min(year), round(predicted.abnd, 1)]
## [1] 0.773913
loess.total.abnd.fit.data[year == floor(year), .(mean.predicted.abnd = mean(predicted.abnd), mean.predicted.abnd.se = mean(predicted.abnd.se)), keyby = .(year)] # Calculate the overall decline
## year mean.predicted.abnd mean.predicted.abnd.se
## 1: 2014 8.896475 2.806116
## 2: 2017 6.052196 1.907727
## 3: 2020 4.600617 1.908573
cat('Percent decline in the Loess Plains (averaged over land uses): ')
## Percent decline in the Loess Plains (averaged over land uses):
1 - loess.total.abnd.fit.data[year == max(year), round(mean(predicted.abnd), 1)] / loess.total.abnd.fit.data[year == min(year), round(mean(predicted.abnd), 1)]
## [1] 0.4831461
We found a 77.4% decline in the Bedouin agriculture, from 11.5 reptiles per survey in 2014 to 2.6 reptiles per survey in 2020. Averaged over all 3 land uses studied, reptile abundance declined by 48.3% percent, from 8.9 to 4.6 reptiles per survey.
Now we will plot the temporal trend:
# Plot the temporal trend:
loess.abnd.effect_plot <- interact_plot(model = loess.abnd.model.full.NB, partial.residuals = F, interval = T,
pred = year.count, modx = habitat, data = loess, colors = "Qual1", point.alpha = 0.25,
plot.points = F, jitter = c(0.2,0), int.type = 'confidence', line.colors = "black", pred.labels = 2013:2020) +
theme_minimal() + theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom',
text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.minor.x = element_blank()) + # scale_y_continuous(limits = c(0, 8), breaks = 0:8) +
scale_x_continuous(breaks = loess[, sort(unique(year.count))], labels = loess[, .(year = unique(year)), keyby = year.count][, year], name = NULL) +
scale_fill_discrete(name = NULL, labels = c(strReverse('חקלאות מסורתית'), strReverse('קציר נגר'), strReverse('לס טבעי'))) +
scale_color_discrete(name = NULL, labels = c(strReverse('חקלאות מסורתית'), strReverse('קציר נגר'), strReverse('לס טבעי'))) +
labs(color = NULL, fill = strReverse('בית גידול'), y = strReverse('שפע'))
## Warning in check_dots(..., .action = "warning"): unknown arguments: interval
## Warning in check_dots(..., .action = "warning"): unknown arguments: interval
## Warning in check_dots(..., .action = "warning"): unknown arguments: interval
## Scale for colour is already present.
## Adding another scale for colour, which will replace the existing scale.
loess.abnd.effect_plot # The prediction seems reasonable
Cairo::Cairo(file = 'Figures/Loess abundance temporal trend interact plot.pdf', width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(loess.abnd.effect_plot)
dev.off()
## png
## 2
loess.total.abnd.fake.effect.plot <- ggplot(data = loess.total.abnd.fit.data, aes(x = year, y = predicted.abnd, color = habitat, fill = habitat, linetype = habitat)) +
geom_ribbon(aes(x = year, ymin = predicted.abnd - 1.96*predicted.abnd.se, ymax = predicted.abnd + 1.96*predicted.abnd.se),
alpha = 0.25, color = NA) + # geom_hline(yintercept = 0) +
geom_line(linewidth = 1) + labs(y = strReverse('שפע כולל'), x = NULL) +
scale_linetype_manual(name = NULL, labels = c(strReverse('חקלאות מסורתית'), strReverse('קציר נגר'), strReverse('לס טבעי')),
values = c('longdash', 'dashed', 'solid')) +
scale_fill_manual(name = NULL, labels = c(strReverse('חקלאות מסורתית'), strReverse('קציר נגר'), strReverse('לס טבעי')),
values = c('#DE5D00', '#6F66AB','#0B9B6D')) +
scale_color_manual(name = NULL, labels = c(strReverse('חקלאות מסורתית'), strReverse('קציר נגר'), strReverse('לס טבעי')),
values = c('#DE5D00', '#6F66AB', '#0B9B6D')) +
# scale_x_date(date_labels = '%Y') +
theme_minimal() + theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom', text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.minor.x = element_blank())
loess.total.abnd.fake.effect.plot
Cairo::Cairo(file = "Figures/loess total abundance fake effect plot.pdf", width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(loess.total.abnd.fake.effect.plot)
dev.off()
## png
## 2
loess.total.abnd.fake.effect.plot2 <- ggplot(data = loess.total.abnd.fit.data[, .(mean.abnd = mean(predicted.abnd), mean.se = mean(predicted.abnd.se)), keyby = .(year)], aes(x = year, y = mean.abnd)) +
geom_ribbon(aes(x = year, ymin = mean.abnd - 1.96*mean.se, ymax = mean.abnd + 1.96*mean.se),
alpha = 0.25, color = NA) + # geom_hline(yintercept = 0) +
geom_line(linewidth = 1) + labs(y = strReverse('שפע כולל'), x = NULL) +
theme_minimal() + theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom', text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.minor.x = element_blank())
loess.total.abnd.fake.effect.plot2
Cairo::Cairo(file = "Figures/loess total abundance fake effect plot - overall unit.pdf", width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(loess.total.abnd.fake.effect.plot2)
dev.off()
## png
## 2
Data exploration:
### Forest----
reptiles[unit %like% 'Forest' & !is.na(SciName), .(total.abnd = sum(count_individuals), total.sp.rich = uniqueN(SciName))]
## total.abnd total.sp.rich
## 1: 481 23
reptiles[unit %like% 'Forest', unique(campaign), keyby = year]
## year V1
## 1: 2014 T0
## 2: 2015 T1
## 3: 2017 T2
## 4: 2019 T3
## 5: 2021 T4
## Forest species richness----
alpha.div[, sort(unique(unit))]
## [1] Coastal Plain Sands
## [2] Inland Sands
## [3] Loess Covered Areas in the Northern Negev
## [4] Mediterranean-Desert Transition Zone
## [5] Planted Conifer Forests
## 5 Levels: Coastal Plain Sands ... Planted Conifer Forests
Forest <- alpha.div[unit == 'Planted Conifer Forests']
str(Forest)
## Classes 'data.table' and 'data.frame': 224 obs. of 23 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 5 5 5 5 5 5 5 5 5 5 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 5 5 5 10 10 10 18 18 18 27 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 32 33 34 80 82 84 135 136 137 218 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 25 26 27 37 38 39 61 62 63 109 ...
## $ Date : Date, format: "2014-07-30" "2014-07-30" ...
## $ sin.dist.21.June : num 0.622 0.622 0.622 0.509 0.509 ...
## $ cos.dist.21.June : num 0.783 0.783 0.783 0.861 0.861 ...
## $ sin.dist.noon : num 0.174 0.288 0.626 0.187 0.577 ...
## $ cos.dist.noon : num 0.985 0.958 0.78 0.982 0.817 ...
## $ settlements : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: NA NA NA NA NA NA NA NA NA NA ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num NaN NaN 35 35.1 35.1 ...
## $ mean.lat : num NaN NaN 32.6 32.7 32.7 ...
## $ species.richness : num 0 0 1 1 1 1 1 2 0 1 ...
## $ total.abundance : num 0 0 1 1 2 2 1 4 0 1 ...
## $ geom.mean.abundance: num 0 0 1 1 2 2 1 3 0 1 ...
## $ year.count : num 0 0 0 0 0 0 0 0 0 0 ...
## $ year.fct : Factor w/ 8 levels "2014","2015",..: 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "sorted")= chr "unit"
## - attr(*, ".internal.selfref")=<externalptr>
Forest[is.na(year) | is.na(subunit)] # no missing variables
## Empty data.table (0 rows and 23 cols): unit,year,campaign,subunit,site,point_name...
Forest[, sort(unique(subunit))] # subunit are now sorted alphabetically
## [1] Carmel Galilee Judean Highlands
## Levels: Carmel Galilee Judean Highlands
Forest[, subunit := fct_relevel(subunit, "Judean Highlands", "Carmel", "Galilee")] # Reorder the Forest subunit from south to north
Forest[, sort(unique(subunit))] # subunit are now sorted alphabetically
## [1] Judean Highlands Carmel Galilee
## Levels: Judean Highlands Carmel Galilee
Forest[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(campaign, year, subunit, site)][no.of.surveys != 3] # Only Ramat Hashofet missed a survey (in 2015)
## campaign year subunit site no.of.surveys
## 1: T1 2015 Carmel Ramat Hashofet 2
Forest[, .(no.of.surveys = uniqueN(survey_ID)), keyby = .(campaign)][no.of.surveys != 45] # T1 missed one survey (Ramat HaShofet, as we noted)
## campaign no.of.surveys
## 1: T1 44
reptiles[unit %like% 'Forest' & campaign == 'T0', .(plot = unique(point_name)), keyby = .(subunit, site, start_Time)]
## subunit site start_Time
## 1: Carmel Bat Shlomo 10:25:00
## 2: Carmel Bat Shlomo 10:53:00
## 3: Carmel Bat Shlomo 11:20:00
## 4: Carmel Elyakim 10:39:00
## 5: Carmel Elyakim 11:17:00
## 6: Carmel Elyakim 12:17:00
## 7: Carmel Kerem Maharal 09:42:00
## 8: Carmel Kerem Maharal 10:27:00
## 9: Carmel Kerem Maharal 11:08:00
## 10: Carmel Ofer 13:00:00
## 11: Carmel Ofer 13:20:00
## 12: Carmel Ofer 13:44:00
## 13: Carmel Ramat Hashofet 13:04:00
## 14: Carmel Ramat Hashofet 13:45:00
## 15: Carmel Ramat Hashofet 14:25:00
## 16: Galilee Kabri 10:00:00
## 17: Galilee Kabri 10:57:00
## 18: Galilee Kabri 11:35:00
## 19: Galilee Manara 10:59:00
## 20: Galilee Manara 11:50:00
## 21: Galilee Manara 13:00:00
## 22: Galilee Meron 13:15:00
## 23: Galilee Meron 13:40:00
## 24: Galilee Meron 14:15:00
## 25: Galilee Ramot Naftali 14:57:00
## 26: Galilee Ramot Naftali 15:45:00
## 27: Galilee Ramot Naftali 16:29:00
## 28: Galilee Zuriel 13:07:00
## 29: Galilee Zuriel 14:15:00
## 30: Galilee Zuriel 15:25:00
## 31: Judean Highlands Aderet 09:45:00
## 32: Judean Highlands Aderet 10:34:00
## 33: Judean Highlands Aderet 11:26:00
## 34: Judean Highlands Amatzia 10:27:00
## 35: Judean Highlands Amatzia 10:57:00
## 36: Judean Highlands Amatzia 11:21:00
## 37: Judean Highlands Eitanim 10:45:00
## 38: Judean Highlands Eitanim 11:33:00
## 39: Judean Highlands Eitanim 11:50:00
## 40: Judean Highlands Eshtaol 10:32:00
## 41: Judean Highlands Eshtaol 11:19:00
## 42: Judean Highlands Eshtaol 11:58:00
## 43: Judean Highlands Givat Yeshayahu 13:47:00
## 44: Judean Highlands Givat Yeshayahu 14:24:00
## 45: Judean Highlands Givat Yeshayahu 14:40:00
## subunit site start_Time
## plot
## 1: Bat Shlomo Kkl 3
## 2: Bat Shlomo Far 2
## 3: Bat Shlomo Far 1
## 4: Elyakim 32.66706551_35.05568276
## 5: Elyakim 32.66729268_35.06300807
## 6: Elyakim 32.663718_35.0561739
## 7: Kerem Maharal Kkl Plantings 2
## 8: Kerem Maharal Kkl Plantings 1
## 9: Kerem Maharal Kkl 3
## 10: Ofer Kkl 3
## 11: Ofer 32.66116094_34.96865537
## 12: Ofer Kkl Plantings 2
## 13: Ramat Hashofet - Kkl Plantings 1
## 14: Ramat Hashofet - Kkl Plantings 3
## 15: Ramat Hashofet - Kkl Plantings 2
## 16: Kabri 33.02026699_35.15765825
## 17: Kabri 33.02052847_35.16410304
## 18: Kabri 33.02175836_35.17061209
## 19: Manara Kkl 2
## 20: Manara Kkl Plantings 3
## 21: Manara Kkl 1
## 22: Meron Kkl Plantings 1
## 23: Meron Kkl Plantings 2
## 24: Meron 32.99189342_35.45548018
## 25: Ramot Naftali 33.09475371_35.56140929
## 26: Ramot Naftali 33.09853595_35.56487564
## 27: Ramot Naftali 33.09405282_35.56702946
## 28: Zuriel Kkl 3
## 29: Zuriel Kkl 2
## 30: Zuriel Kkl Plantings 1
## 31: Aderet 31.67867469_34.98154177
## 32: Aderet Kkl 3
## 33: Aderet Kkl 2
## 34: Amatzia 31.51440028_34.89825118
## 35: Amatzia 31.51244878_34.8934848
## 36: Amatzia 31.50752022_34.89495214
## 37: Eitanim Far 3
## 38: Eitanim Kkl 2
## 39: Eitanim Far 1
## 40: Eshtaol Kkl 4
## 41: Eshtaol Kkl 3
## 42: Eshtaol Far 1
## 43: Givat Yeshayahu 3
## 44: Givat Yeshayahu 2
## 45: Givat Yeshayahu Far 1
## plot
# Meron and Ramat HaShofet are recorded in the original Excel file but not here!
# Dot plots
Forest.sp.rich.dotplot <- ggplot(data = Forest, aes(x = species.richness, y = site, color = subunit)) +
geom_point() + geom_line(aes(group = site)) +
facet_grid(campaign ~ .) + labs(title = 'Reptile Species Richness in the Forest', y = 'Site', x = 'Species Richness') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, Forest[, max(species.richness)]),
breaks = seq(0, Forest[, max(species.richness)], by = 1)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
Forest.sp.rich.dotplot
ggsave('Figures/Reptile species richness in the Forest - dotplot.png', plot = Forest.sp.rich.dotplot, scale = 1.25)
## Saving 8.75 x 6.25 in image
Forest.abnd.dotplot <- ggplot(data = Forest, aes(x = total.abundance, y = site, color = subunit)) +
geom_point(aes(color = subunit)) + geom_line(aes(group = site, color = subunit)) +
facet_grid(campaign ~ .) + labs(title = 'Reptile Total Abundance in the Forest', y = 'Site', x = 'Total Abundance') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, Forest[, max(total.abundance) + 1]),
breaks = seq(0, Forest[, max(total.abundance) + 1], by = 2)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
Forest.abnd.dotplot
ggsave('Figures/Reptile Total Abundance in the Forest - dotplot.png', plot = Forest.abnd.dotplot, scale = 1.25)
## Saving 8.75 x 6.25 in image
# The relevant predictor is the subunit and the temporal trend
Explore species richness:
# Plot species richness
ggplot(data = Forest, aes(x = subunit, y = species.richness, color = subunit)) + geom_boxplot() +
geom_jitter(height = 0, width = 0.3) + facet_wrap(.~ year) + theme_bw()
2014 seem lower than the later years, and Galilee might be lower than
the other subunits. Otherwise, there is no apparent trend.
# Forest species richness - glmm model selection ----
Forest[, .(mean.richness = mean(species.richness), var.richness = var(species.richness))] # var < mean -> try Poisson models
## mean.richness var.richness
## 1: 1.375 1.096413
anyNA(Forest[, .(subunit, sin.dist.21.June, cos.dist.21.June, sin.dist.noon, cos.dist.noon, species.richness)]) # No missing values
## [1] FALSE
reptiles[is.na(ITime)] # no missing ITimes in the original data
## Empty data.table (0 rows and 78 cols): unit,campaign,year,site,point_name,mean.lat...
# Full model, Poisson response
Forest.sp.rich.model.full.Poisson <- glmmTMB(species.richness ~ subunit + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'poisson', data = Forest)
summary(Forest.sp.rich.model.full.Poisson)
## Family: poisson ( log )
## Formula:
## species.richness ~ subunit + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 628.0 655.3 -306.0 612.0 216
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.03276 0.181
## Number of obs: 224, groups: site, 15
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.42485 0.33177 1.281 0.20036
## subunitCarmel 0.30661 0.18755 1.635 0.10209
## subunitGalilee -0.12115 0.21619 -0.560 0.57523
## sin.dist.21.June -0.38307 0.11767 -3.256 0.00113 **
## cos.dist.21.June -0.35494 0.13152 -2.699 0.00696 **
## sin.dist.noon 0.27057 0.13385 2.021 0.04323 *
## cos.dist.noon 0.04501 0.33455 0.135 0.89297
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat('PHI = '); deviance(Forest.sp.rich.model.full.Poisson)/df.residual(Forest.sp.rich.model.full.Poisson)
## PHI =
## [1] 0.8138639
drop1(Forest.sp.rich.model.full.Poisson) # Can drop cosine distance to noon
## Single term deletions
##
## Model:
## species.richness ~ subunit + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 627.99
## subunit 2 628.49
## sin.dist.21.June 1 636.69
## cos.dist.21.June 1 632.80
## sin.dist.noon 1 630.10
## cos.dist.noon 1 626.00
PHI < 1 so we proceed with Poisson models. We can drop cosine diel pattern:
Forest.sp.rich.model1 <- glmmTMB(species.richness ~ subunit + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + (1|site), family = 'poisson', data = Forest)
summary(Forest.sp.rich.model1)
## Family: poisson ( log )
## Formula:
## species.richness ~ subunit + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 626.0 649.9 -306.0 612.0 217
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.03289 0.1814
## Number of obs: 224, groups: site, 15
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.4649 0.1464 3.176 0.00150 **
## subunitCarmel 0.3039 0.1867 1.628 0.10345
## subunitGalilee -0.1266 0.2127 -0.595 0.55189
## sin.dist.21.June -0.3826 0.1176 -3.253 0.00114 **
## cos.dist.21.June -0.3568 0.1308 -2.727 0.00639 **
## sin.dist.noon 0.2725 0.1329 2.051 0.04029 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(Forest.sp.rich.model1) # Can drop cosine distance to noon
## Single term deletions
##
## Model:
## species.richness ~ subunit + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Df AIC
## <none> 626.00
## subunit 2 626.52
## sin.dist.21.June 1 634.69
## cos.dist.21.June 1 630.94
## sin.dist.noon 1 628.27
We can drop the subunit since delta AIC < 2 if we do:
Forest.sp.rich.model2 <- glmmTMB(species.richness ~ sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + (1|site), family = 'poisson', data = Forest)
summary(Forest.sp.rich.model2)
## Family: poisson ( log )
## Formula:
## species.richness ~ sin.dist.21.June + cos.dist.21.June + sin.dist.noon +
## (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 626.5 643.6 -308.3 616.5 219
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.0643 0.2536
## Number of obs: 224, groups: site, 15
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.4966 0.1167 4.254 2.1e-05 ***
## sin.dist.21.June -0.3327 0.1123 -2.963 0.00305 **
## cos.dist.21.June -0.3103 0.1303 -2.381 0.01728 *
## sin.dist.noon 0.3226 0.1231 2.620 0.00879 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(Forest.sp.rich.model2) # Can drop cosine distance to noon
## Single term deletions
##
## Model:
## species.richness ~ sin.dist.21.June + cos.dist.21.June + sin.dist.noon +
## (1 | site)
## Df AIC
## <none> 626.52
## sin.dist.21.June 1 633.34
## cos.dist.21.June 1 629.90
## sin.dist.noon 1 631.24
No more predictors to drop. Proceed to model diagnostics:
forest.sp.rich.sim.res <- simulateResiduals(Forest.sp.rich.model2)
plot(forest.sp.rich.sim.res)
testDispersion(forest.sp.rich.sim.res)
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.65322, p-value < 2.2e-16
## alternative hypothesis: two.sided
testDispersion(forest.sp.rich.sim.res, alternative = 'less')
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.65322, p-value < 2.2e-16
## alternative hypothesis: less
plot(forest.sp.rich.sim.res$fittedPredictedResponse, forest.sp.rich.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nForest species richness model 4')
plot(fitted(Forest.sp.rich.model2), residuals(Forest.sp.rich.model2), main = 'Response scale residuals\nForest species richness model 4')
# Export these graphs:
png('Analysis/Model diagnostics/Forest species richness model 4 QQ Plot.png')
plot(forest.sp.rich.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Forest species richness model 4 fitted vs. scaled residuals.png')
plot(forest.sp.rich.sim.res$fittedPredictedResponse, forest.sp.rich.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nForest species richness model 4')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Forest species richness model 4 fitted vs. residuals.png')
plot(fitted(Forest.sp.rich.model2), residuals(Forest.sp.rich.model2), main = 'Response scale residuals\nForest species richness model 4')
dev.off()
## png
## 2
We have clear indications of under-dispersion (yes, again), which means we have lower statistical power. Back up and document species richness models:
# The chosen model is Forest.sp.rich.model2 (time of day and season)
capture.output(cat('The best fitting model for species richness in the planted forest is Forest.sp.rich.model2.\n'),
summary(Forest.sp.rich.model2), cat('\n------\n'),
file = 'Output/Planted conifer forest species richness best fitting model.txt')
for(model in ls()[grep('*Forest.sp.rich.model.', ls())]){
sp.rich.comparison <- rbind(sp.rich.comparison,
data.table(unit = 'Planted Conifer Forest', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
sp.rich.comparison <- sp.rich.comparison[!(formula %like% '~' | formula %like% 'species.richness')] # remove redundant rows
sp.rich.comparison <- unique(sp.rich.comparison)
setorder(sp.rich.comparison, unit, AIC) # Sort by AIC (ascending)
sp.rich.comparison[unit == 'Planted Conifer Forest', .(model, family, formula, no.of.preds, AIC, BIC)] # View the table
## model family
## 1: Forest.sp.rich.model1 poisson
## 2: Forest.sp.rich.model2 poisson
## 3: Forest.sp.rich.model.full.Poisson poisson
## formula
## 1: subunit + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + (1 | site)
## 2: sin.dist.21.June + cos.dist.21.June + sin.dist.noon + (1 | site)
## 3: subunit + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## no.of.preds AIC BIC
## 1: 4 626.0046 649.8862
## 2: 3 626.5168 643.5751
## 3: 5 627.9865 655.2796
write_excel_csv(sp.rich.comparison, file = 'Analysis/Species richness models of reptiles - AIC comparison.csv')
save(list = ls()[grep('*Forest.sp.rich.model', ls())], file = 'Analysis/Forest reptile species richness models.Rdata')
rm(list = setdiff(ls()[grep('*Forest.sp.rich.model', ls())], c('Forest.sp.rich.model2'))) # Clean up
Again, no researcher’s hypotheses were confirmed so we do not explore the chosen model’s predictions but continue directly to total abundance:
## Forest total abundance----
str(Forest)
## Classes 'data.table' and 'data.frame': 224 obs. of 23 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 5 5 5 5 5 5 5 5 5 5 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Judean Highlands",..: 2 2 2 2 2 2 2 2 2 2 ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 5 5 5 10 10 10 18 18 18 27 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 32 33 34 80 82 84 135 136 137 218 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 25 26 27 37 38 39 61 62 63 109 ...
## $ Date : Date, format: "2014-07-30" "2014-07-30" ...
## $ sin.dist.21.June : num 0.622 0.622 0.622 0.509 0.509 ...
## $ cos.dist.21.June : num 0.783 0.783 0.783 0.861 0.861 ...
## $ sin.dist.noon : num 0.174 0.288 0.626 0.187 0.577 ...
## $ cos.dist.noon : num 0.985 0.958 0.78 0.982 0.817 ...
## $ settlements : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: NA NA NA NA NA NA NA NA NA NA ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num NaN NaN 35 35.1 35.1 ...
## $ mean.lat : num NaN NaN 32.6 32.7 32.7 ...
## $ species.richness : num 0 0 1 1 1 1 1 2 0 1 ...
## $ total.abundance : num 0 0 1 1 2 2 1 4 0 1 ...
## $ geom.mean.abundance: num 0 0 1 1 2 2 1 3 0 1 ...
## $ year.count : num 0 0 0 0 0 0 0 0 0 0 ...
## $ year.fct : Factor w/ 8 levels "2014","2015",..: 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "sorted")= chr "unit"
## - attr(*, ".internal.selfref")=<externalptr>
Forest[is.na(year)] # no missing variables
## Empty data.table (0 rows and 23 cols): unit,year,campaign,subunit,site,point_name...
# The relevant predictor is the subunit and the temporal trend
# Plot total abundance
ggplot(data = Forest, aes(x = subunit, y = total.abundance, color = subunit)) + geom_boxplot() +
geom_jitter(height = 0, width = 0.3) + facet_wrap(.~ year) + theme_bw()
Subunit and annual differences seem minor; Galilee could be lower. Start
model selection for total reptile abundance:
# Full model, Poisson response
Forest.abnd.model.full.Poisson <- glmmTMB(total.abundance ~ subunit * year.count + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site) , family = 'poisson', data = Forest)
summary(Forest.abnd.model.full.Poisson)
## Family: poisson ( log )
## Formula:
## total.abundance ~ subunit * year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 816.8 854.3 -397.4 794.8 213
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.1764 0.42
## Number of obs: 224, groups: site, 15
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.585534 0.386080 1.517 0.12936
## subunitCarmel 0.560234 0.328708 1.704 0.08832 .
## subunitGalilee 0.009182 0.350655 0.026 0.97911
## year.count 0.002622 0.045044 0.058 0.95358
## sin.dist.21.June -0.542685 0.136285 -3.982 6.83e-05 ***
## cos.dist.21.June -0.918918 0.103643 -8.866 < 2e-16 ***
## sin.dist.noon 0.376482 0.127425 2.955 0.00313 **
## cos.dist.noon 0.322350 0.311127 1.036 0.30017
## subunitCarmel:year.count 0.076228 0.047148 1.617 0.10593
## subunitGalilee:year.count 0.022637 0.056205 0.403 0.68713
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat('PHI = '); deviance(Forest.abnd.model.full.Poisson)/df.residual(Forest.abnd.model.full.Poisson)
## PHI =
## [1] 1.350381
drop1(Forest.abnd.model.full.Poisson)
## Single term deletions
##
## Model:
## total.abundance ~ subunit * year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 816.76
## sin.dist.21.June 1 830.70
## cos.dist.21.June 1 890.07
## sin.dist.noon 1 823.48
## cos.dist.noon 1 815.85
## subunit:year.count 2 815.67
The trend is significantly positive, but PHI > 1. Let’s try fitting a negative binomial full model:
Forest.abnd.model.full.NB <- glmmTMB(total.abundance ~ subunit * year.count + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site) , family = 'nbinom2', data = Forest)
summary(Forest.abnd.model.full.NB)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ subunit * year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 804 845 -390 780 212
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.1617 0.4021
## Number of obs: 224, groups: site, 15
##
## Dispersion parameter for nbinom2 family (): 6.35
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.613192 0.428437 1.431 0.152365
## subunitCarmel 0.505179 0.343191 1.472 0.141019
## subunitGalilee 0.056809 0.364564 0.156 0.876168
## year.count 0.001368 0.053316 0.026 0.979534
## sin.dist.21.June -0.539003 0.158844 -3.393 0.000691 ***
## cos.dist.21.June -0.879596 0.126718 -6.941 3.88e-12 ***
## sin.dist.noon 0.385811 0.147261 2.620 0.008795 **
## cos.dist.noon 0.282370 0.354852 0.796 0.426183
## subunitCarmel:year.count 0.083825 0.057372 1.461 0.143995
## subunitGalilee:year.count 0.016294 0.064047 0.254 0.799178
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(Forest.abnd.model.full.NB)
## Single term deletions
##
## Model:
## total.abundance ~ subunit * year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 804.02
## sin.dist.21.June 1 813.33
## cos.dist.21.June 1 843.58
## sin.dist.noon 1 808.87
## cos.dist.noon 1 802.66
## subunit:year.count 2 802.58
AIC is clearly lower for the negative binomial model. We can drop the interaction between year and trend:
Forest.abnd.model1 <- glmmTMB(total.abundance ~ subunit + year.count + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site) , family = 'nbinom2', data = Forest)
summary(Forest.abnd.model1)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ subunit + year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 802.6 836.7 -391.3 782.6 214
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.1651 0.4064
## Number of obs: 224, groups: site, 15
##
## Dispersion parameter for nbinom2 family (): 6.21
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.42254 0.41014 1.030 0.30289
## subunitCarmel 0.76511 0.29861 2.562 0.01040 *
## subunitGalilee 0.08202 0.31800 0.258 0.79647
## year.count 0.04595 0.03479 1.321 0.18657
## sin.dist.21.June -0.48443 0.15120 -3.204 0.00136 **
## cos.dist.21.June -0.86289 0.12636 -6.829 8.57e-12 ***
## sin.dist.noon 0.31423 0.13884 2.263 0.02362 *
## cos.dist.noon 0.33737 0.35076 0.962 0.33614
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(Forest.abnd.model1)
## Single term deletions
##
## Model:
## total.abundance ~ subunit + year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 802.58
## subunit 2 804.99
## year.count 1 802.31
## sin.dist.21.June 1 810.70
## cos.dist.21.June 1 840.57
## sin.dist.noon 1 805.68
## cos.dist.noon 1 801.51
We can further drop the cosine diel pattern:
Forest.abnd.model2 <- glmmTMB(total.abundance ~ subunit + year.count + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + (1|site) , family = 'nbinom2', data = Forest)
summary(Forest.abnd.model2)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ subunit + year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 801.5 832.2 -391.8 783.5 215
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.1645 0.4056
## Number of obs: 224, groups: site, 15
##
## Dispersion parameter for nbinom2 family (): 6.11
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.74058 0.24293 3.049 0.002299 **
## subunitCarmel 0.75151 0.29803 2.522 0.011681 *
## subunitGalilee 0.04570 0.31615 0.145 0.885060
## year.count 0.04002 0.03428 1.167 0.243031
## sin.dist.21.June -0.49982 0.15015 -3.329 0.000872 ***
## cos.dist.21.June -0.87699 0.12583 -6.970 3.17e-12 ***
## sin.dist.noon 0.33563 0.13669 2.455 0.014070 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(Forest.abnd.model2)
## Single term deletions
##
## Model:
## total.abundance ~ subunit + year.count + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Df AIC
## <none> 801.51
## subunit 2 803.95
## year.count 1 800.86
## sin.dist.21.June 1 810.41
## cos.dist.21.June 1 841.07
## sin.dist.noon 1 805.53
Next, drop the trend:
Forest.abnd.model3 <- glmmTMB(total.abundance ~ subunit + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + (1|site) , family = 'nbinom2', data = Forest)
summary(Forest.abnd.model3)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ subunit + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 800.9 828.2 -392.4 784.9 216
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.153 0.3911
## Number of obs: 224, groups: site, 15
##
## Dispersion parameter for nbinom2 family (): 5.92
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.85934 0.21521 3.993 6.52e-05 ***
## subunitCarmel 0.77101 0.28981 2.660 0.0078 **
## subunitGalilee 0.02316 0.30819 0.075 0.9401
## sin.dist.21.June -0.60295 0.12163 -4.957 7.15e-07 ***
## cos.dist.21.June -0.84498 0.12315 -6.861 6.83e-12 ***
## sin.dist.noon 0.32187 0.13661 2.356 0.0185 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(Forest.abnd.model3)
## Single term deletions
##
## Model:
## total.abundance ~ subunit + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Df AIC
## <none> 800.86
## subunit 2 804.13
## sin.dist.21.June 1 822.84
## cos.dist.21.June 1 839.11
## sin.dist.noon 1 804.41
No more predictors to drop. Proceed to model diagnostics:
# The chosen model is Forest.abnd.model3 (subunit, diel pattern and seasonality with site ID)
summary(Forest.abnd.model3)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ subunit + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 800.9 828.2 -392.4 784.9 216
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.153 0.3911
## Number of obs: 224, groups: site, 15
##
## Dispersion parameter for nbinom2 family (): 5.92
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.85934 0.21521 3.993 6.52e-05 ***
## subunitCarmel 0.77101 0.28981 2.660 0.0078 **
## subunitGalilee 0.02316 0.30819 0.075 0.9401
## sin.dist.21.June -0.60295 0.12163 -4.957 7.15e-07 ***
## cos.dist.21.June -0.84498 0.12315 -6.861 6.83e-12 ***
## sin.dist.noon 0.32187 0.13661 2.356 0.0185 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
forest.abnd.sim.res <- simulateResiduals(Forest.abnd.model3)
plot(forest.abnd.sim.res) # QQ plot seems ok; all tests are ok (non-significant)
testDispersion(forest.abnd.sim.res)
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 1.1557, p-value = 0.472
## alternative hypothesis: two.sided
testDispersion(forest.abnd.sim.res, alternative = 'less', plot = F)
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 1.1557, p-value = 0.764
## alternative hypothesis: less
plot(forest.abnd.sim.res$fittedPredictedResponse, forest.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nForest total abundance model 4')
plot(fitted(Forest.abnd.model3), residuals(Forest.abnd.model3), main = 'Response scale residuals\nForest total abundance model 3')
# Export these graphs:
png('Analysis/Model diagnostics/Forest total abundance model 3 QQ Plot.png')
plot(forest.abnd.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Forest total abundance model 3 fitted vs. scaled residuals.png')
plot(forest.abnd.sim.res$fittedPredictedResponse, forest.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nForest total abundance model 3')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Forest total abundance model 3 fitted vs. residuals.png')
plot(fitted(Forest.abnd.model3), residuals(Forest.abnd.model3), main = 'Response scale residuals\nForest total abundance model 3')
dev.off()
## png
## 2
We found no significant problems this time. As one research hypothesis was included in the chosen model (subunit), let’s proceed to test for significant differences between all 3 subunits:
EMM <- emmeans(object = Forest.abnd.model3, ~subunit)
test_results_land_use <- test(pairs(EMM), by=NULL, adjust="fdr")
print(test_results_land_use)
## contrast estimate SE df z.ratio p.value
## Judean Highlands - Carmel -0.7710 0.290 Inf -2.660 0.0171
## Judean Highlands - Galilee -0.0232 0.308 Inf -0.075 0.9401
## Carmel - Galilee 0.7478 0.296 Inf 2.530 0.0171
##
## Results are given on the log (not the response) scale.
## P value adjustment: fdr method for 3 tests
capture.output(test_results_land_use, file = 'Output/Compare Forest subunits - reptile abundance.txt') # Export the results
We found significant differences between Carmel and Galilee and between Carmel and Judean Highlands, but not between Galilee and Judean Highlands. Proceed to documenting and backing up the models:
file.remove('Analysis/Planted Conifer Forest - total abundance model selection.txt')
## [1] TRUE
for (model in c(ls()[grep('*Forest.abnd.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/Planted Conifer Forest - total abundance model selection.txt', append = T)
}
# load('Analysis/Planted Conifer Forest - total abundance models.Rdata')
save(list = ls()[grep('*Forest.abnd.model', ls())], file = 'Analysis/Planted Conifer Forest - total abundance models.Rdata')
capture.output(cat('The best fitting model for total abundance in the Planted Conifer Forest is Forest.abnd.model3.'),
summary(Forest.abnd.model3), file = 'Output/Planted Conifer Forest total abundance - best fitting model.txt', append = F)
# Create a table comparing total abundance models:
for(model in ls()[grep('*Forest.abnd.model', ls())]){
total.abnd.comparison <- rbind(total.abnd.comparison,
data.table(unit = 'Planted Conifer Forest', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
total.abnd.comparison <- total.abnd.comparison[!(formula %like% '~' | formula %like% 'total.abundance')] # remove redundant rows
total.abnd.comparison <- unique(total.abnd.comparison)
setorder(total.abnd.comparison, unit, AIC) # Sort by AIC (ascending)
total.abnd.comparison[unit == 'Planted Conifer Forest', .(model, family, formula, no.of.preds, AIC, BIC)] # View the table
## model family
## 1: Forest.abnd.model3 nbinom2
## 2: Forest.abnd.model2 nbinom2
## 3: Forest.abnd.model1 nbinom2
## 4: Forest.abnd.model.full.NB nbinom2
## 5: Forest.abnd.model.full.Poisson poisson
## formula
## 1: subunit + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + (1 | site)
## 2: subunit + year.count + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + (1 | site)
## 3: subunit + year.count + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## 4: subunit * year.count + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## 5: subunit * year.count + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## no.of.preds AIC BIC
## 1: 4 800.8634 828.1566
## 2: 5 801.5098 832.2146
## 3: 6 802.5777 836.6941
## 4: 7 804.0222 844.9619
## 5: 7 816.7616 854.2897
write_excel_csv(total.abnd.comparison, file = 'Analysis/Planted Conifer Forest total abundance models of reptiles - AIC comparison.csv')
rm(list = setdiff(ls()[grep('*Forest.abnd.model', ls())], c('Forest.abnd.model3'))) # Clean up
We found that the subunit has a significant impact on reptile total abundance, so let’s explore the chosen model’s predictions:
summary(Forest.abnd.model3)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ subunit + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + (1 | site)
## Data: Forest
##
## AIC BIC logLik deviance df.resid
## 800.9 828.2 -392.4 784.9 216
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.153 0.3911
## Number of obs: 224, groups: site, 15
##
## Dispersion parameter for nbinom2 family (): 5.92
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.85934 0.21521 3.993 6.52e-05 ***
## subunitCarmel 0.77101 0.28981 2.660 0.0078 **
## subunitGalilee 0.02316 0.30819 0.075 0.9401
## sin.dist.21.June -0.60295 0.12163 -4.957 7.15e-07 ***
## cos.dist.21.June -0.84498 0.12315 -6.861 6.83e-12 ***
## sin.dist.noon 0.32187 0.13661 2.356 0.0185 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Predict by the mean observed values
reptiles[, sort(unique(unit))]
## [1] Coastal Plain Sands
## [2] Inland Sands
## [3] Loess Covered Areas in the Northern Negev
## [4] Mediterranean-Desert Transition Zone
## [5] Planted Conifer Forests
## 5 Levels: Coastal Plain Sands ... Planted Conifer Forests
quantile(reptiles[unit == 'Planted Conifer Forests', .(day.of.year = unique(yday(Date))), by = survey_ID][, day.of.year])
## 0% 25% 50% 75% 100%
## 98 142 172 217 329
# Dates vary from 98 (April 7th) to 329 (November 25th) with a median of 172 (June 21st)
## Calculate the median radian angle of the date and time of sampling and use this for model fit to predict trends
# Create a table to be filled by a loop with predictor values to be used for predictions
Forest.total.abnd.fit.data <- data.table(expand.grid(site = NA,
dist.21.June.radians = reptiles[unit == 'Planted Conifer Forests', .(dist.21.June.radians = unique(dist.21.June.radians)),
keyby = survey_ID][, median(dist.21.June.radians)],
dist.noon.radians = reptiles[unit == 'Planted Conifer Forests', .(dist.noon.radians = unique(dist.noon.radians)),
keyby = survey_ID][, median(dist.noon.radians)],
subunit = Forest[, sort(unique(subunit))]))
setorder(Forest.total.abnd.fit.data, subunit, dist.21.June.radians, dist.noon.radians)
Forest.total.abnd.fit.data # seems ok
## site dist.21.June.radians dist.noon.radians subunit
## 1: NA 0 -0.08290314 Judean Highlands
## 2: NA 0 -0.08290314 Carmel
## 3: NA 0 -0.08290314 Galilee
Forest.total.abnd.fit.data[, ':=' (sin.dist.21.June = sin(dist.21.June.radians), cos.dist.21.June = cos(dist.21.June.radians),
sin.dist.noon = sin(dist.noon.radians))] # Calculate the sin and cosine of the distance from June 21st
Forest.total.abnd.fit.data
## site dist.21.June.radians dist.noon.radians subunit
## 1: NA 0 -0.08290314 Judean Highlands
## 2: NA 0 -0.08290314 Carmel
## 3: NA 0 -0.08290314 Galilee
## sin.dist.21.June cos.dist.21.June sin.dist.noon
## 1: 0 1 -0.08280821
## 2: 0 1 -0.08280821
## 3: 0 1 -0.08280821
bla <- predict(Forest.abnd.model3, newdata = Forest.total.abnd.fit.data, type = 'response', se.fit = T)
Forest.total.abnd.fit.data[, ':=' (predicted.abnd = bla$fit, predicted.abnd.se = bla$se.fit)]
Forest.total.abnd.fit.data[, .(subunit, predicted.abnd, predicted.abnd.se)]
## subunit predicted.abnd predicted.abnd.se
## 1: Judean Highlands 0.9877851 0.2212815
## 2: Carmel 2.1355317 0.4294810
## 3: Galilee 1.0109318 0.2267583
write_excel_csv(Forest.total.abnd.fit.data, file = 'Output/Planted forest - predictions of total reptile abundance.csv')
Predictions are considerably lower than the observations. Let’s try predicting for range of surveyed dates to see if it a seasonal issue:
Forest.total.abnd.fit.data2 <- data.table(expand.grid(site = NA, subunit = Forest[, unique(subunit)],
dist.noon.radians = reptiles[unit == 'Planted Conifer Forests', .(dist.noon.radians = unique(dist.noon.radians)), keyby = survey_ID][, median(dist.noon.radians)],
Date = seq.Date(from = as.Date('2015-04-07'), to = as.Date('2015-11-24'), by = 1)))
Forest.total.abnd.fit.data2
## site subunit dist.noon.radians Date
## 1: NA Carmel -0.08290314 2015-04-07
## 2: NA Galilee -0.08290314 2015-04-07
## 3: NA Judean Highlands -0.08290314 2015-04-07
## 4: NA Carmel -0.08290314 2015-04-08
## 5: NA Galilee -0.08290314 2015-04-08
## ---
## 692: NA Galilee -0.08290314 2015-11-23
## 693: NA Judean Highlands -0.08290314 2015-11-23
## 694: NA Carmel -0.08290314 2015-11-24
## 695: NA Galilee -0.08290314 2015-11-24
## 696: NA Judean Highlands -0.08290314 2015-11-24
Forest.total.abnd.fit.data2[, ':=' (dist.21.June = yday(Date) - yday('2015-06-21'))]
Forest.total.abnd.fit.data2[, ':=' (dist.21.June.radians = dist.21.June * pi /182.5)]
Forest.total.abnd.fit.data2[, ':=' (sin.dist.21.June = sin(dist.21.June.radians),
cos.dist.21.June = cos(dist.21.June.radians),
sin.dist.noon = sin(dist.noon.radians))]
bla2 <- predict(Forest.abnd.model3, newdata = Forest.total.abnd.fit.data2, type = 'response', se.fit = T)
Forest.total.abnd.fit.data2[, ':=' (predicted.abnd = bla2$fit, predicted.abnd.se = bla2$se.fit)]
Forest.total.abnd.fit.data2[, .(mean.predicted.abnd = mean(predicted.abnd)), keyby = .(subunit)]
## subunit mean.predicted.abnd
## 1: Judean Highlands 1.604874
## 2: Carmel 3.469640
## 3: Galilee 1.642481
ggplot(data = Forest.total.abnd.fit.data2, aes(x = Date, y = predicted.abnd, color = subunit)) + geom_line() +
geom_point(data = reptiles[unit %like% 'Forest' & is.rare.in.unit == F, .(total.abnd = sum(count_individuals, na.rm = T)),
keyby = .(subunit, survey_ID, Date = as.Date(paste('2015', month(Date), day(Date), sep = '-')))],
aes(x = Date, y = total.abnd, color = subunit)) + scale_x_date(date_labels = '%d/%m')
ggsave('Analysis/Forest.abnd.model3 Predictions and observations in reptile total abundance in Forest with seasonal pattern.png')
## Saving 7 x 5 in image
Forest[, .(mean.abnd = mean(total.abundance, na.rm = T), var.abnd = var(total.abundance, na.rm = T),
median.abnd = median(total.abundance, na.rm = T)), keyby = subunit]
## subunit mean.abnd var.abnd median.abnd
## 1: Judean Highlands 2.120000 6.755676 1
## 2: Carmel 2.891892 9.248427 2
## 3: Galilee 1.440000 2.438919 1
It seems that seasonal variation is considerable. As there are more observations (and higher abundance) in the spring, let’s predict for May 1st this time:
Forest.total.abnd.fit.data3 <- data.table(expand.grid(site = NA, subunit = Forest[, unique(subunit)],
dist.noon.radians = reptiles[unit == 'Planted Conifer Forests', .(dist.noon.radians = unique(dist.noon.radians)), keyby = survey_ID][, median(dist.noon.radians)],
Date = as.Date('2015-05-01')))
Forest.total.abnd.fit.data3
## site subunit dist.noon.radians Date
## 1: NA Carmel -0.08290314 2015-05-01
## 2: NA Galilee -0.08290314 2015-05-01
## 3: NA Judean Highlands -0.08290314 2015-05-01
Forest.total.abnd.fit.data3[, ':=' (dist.21.June = yday(Date) - yday('2015-06-21'))]
Forest.total.abnd.fit.data3[, ':=' (dist.21.June.radians = dist.21.June * pi /182.5)]
Forest.total.abnd.fit.data3[, ':=' (sin.dist.21.June = sin(dist.21.June.radians),
cos.dist.21.June = cos(dist.21.June.radians),
sin.dist.noon = sin(dist.noon.radians))]
bla2 <- predict(Forest.abnd.model3, newdata = Forest.total.abnd.fit.data3, type = 'response', se.fit = T)
Forest.total.abnd.fit.data3[, ':=' (predicted.abnd = bla2$fit, predicted.abnd.se = bla2$se.fit)]
Forest.total.abnd.fit.data3[, .(mean.predicted.abnd = mean(predicted.abnd)), keyby = .(subunit)]
## subunit mean.predicted.abnd
## 1: Judean Highlands 2.131615
## 2: Carmel 4.608424
## 3: Galilee 2.181566
ggplot(data = Forest.total.abnd.fit.data3, aes(x = subunit, y = predicted.abnd, color = subunit)) +
geom_boxplot(data = reptiles[unit %like% 'Forest' & is.rare.in.unit == F, .(total.abnd = sum(count_individuals, na.rm = T)),
keyby = .(subunit, survey_ID)], aes(x = subunit, y = total.abnd, color = subunit)) +
geom_point(shape = 2, size = 5) + theme_bw() + labs(title = 'Forest total abundance - observations vs. predictions',
subtitle = 'Predictions are for May 1st; No trend was included in the final model')
ggsave('Analysis/Forest.abnd.model3 Predictions and observations in reptile total abundance in Forest at May 1st.png')
## Saving 7 x 5 in image
Forest[, .(mean.abnd = mean(total.abundance, na.rm = T), var.abnd = var(total.abundance, na.rm = T),
median.abnd = median(total.abundance, na.rm = T)), keyby = subunit]
## subunit mean.abnd var.abnd median.abnd
## 1: Judean Highlands 2.120000 6.755676 1
## 2: Carmel 2.891892 9.248427 2
## 3: Galilee 1.440000 2.438919 1
This seems more or less ok. Proceed to plotting the effect of subunits:
# Effect plot of subunit
Forest.abnd.effect.plot <- effect_plot(model = Forest.abnd.model3, pred = subunit, data = Forest, colors = "Qual1", point.size = 4,
line.colors = 'black', point.alpha = 0.25, interval = T, plot.points = T, partial.residuals = F,
jitter = c(0.1,0), int.type = 'confidence', legend.main = strReverse('תת-יחידה')) +
theme_minimal() + labs(x = strReverse('תת-יחידה'), y = strReverse('שפע כולל')) +
scale_x_discrete(labels = c(strReverse('הרי יהודה'), strReverse('כרמל'), strReverse('גליל'))) +
theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom',
text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major.y = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.minor.x = element_blank(), panel.grid.major.x = element_blank())
## Warning in check_dots(..., .action = "warning"): unknown arguments: interval
Forest.abnd.effect.plot$layers[[2]]$geom_params$width <- 0.4
Forest.abnd.effect.plot # Note that the order of the subunit is wrong - should be Galilee, Carmel and Judean Highlands (north to south)
Cairo::Cairo(file = 'Figures/Planted Conifer Forest total abundance model3 effect plot - subunits.pdf', width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(Forest.abnd.effect.plot)
dev.off()
## png
## 2
Data exploration first:
### Mediterranean-Desert Transition Zone (Semi desert, Sfar HaMidbar)----
## semi-desert species richness----
reptiles[unit %like% 'Transition', .(total.abnd = sum(count_individuals), total.sp.rich = uniqueN(SciName))]
## total.abnd total.sp.rich
## 1: 409 28
reptiles[unit %like% 'Transition' & !is.na(SciName), .(total.abnd = sum(count_individuals), total.sp.rich = uniqueN(SciName))]
## total.abnd total.sp.rich
## 1: 409 27
reptiles[unit %like% 'Transition', sort(unique(year))]
## [1] 2014 2016 2018 2020
sfar <- alpha.div[unit == 'Mediterranean-Desert Transition Zone']
str(sfar)
## Classes 'data.table' and 'data.frame': 119 obs. of 23 variables:
## $ unit : Factor w/ 5 levels "Coastal Plain Sands",..: 4 4 4 4 4 4 4 4 4 4 ...
## $ year : num 2014 2014 2014 2014 2014 ...
## $ campaign : Factor w/ 5 levels "T0","T1","T2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ subunit : Factor w/ 3 levels "Carmel","Galilee",..: NA NA NA NA NA NA NA NA NA NA ...
## $ site : Factor w/ 35 levels "Aderet","Amatzia",..: 7 7 7 7 7 7 16 16 16 16 ...
## $ point_name : Factor w/ 285 levels "Aderet 31.67144877_34.9880248",..: 52 53 54 57 58 61 117 119 120 124 ...
## $ survey_ID : Factor w/ 697 levels "T0_Aderet 31.67867469_34.98154177",..: 28 29 30 31 32 33 52 53 54 55 ...
## $ Date : Date, format: "2014-05-27" "2014-04-16" ...
## $ sin.dist.21.June : num -0.417 -0.907 0.086 -0.907 -0.907 ...
## $ cos.dist.21.June : num 0.909 0.421 0.996 0.421 0.421 ...
## $ sin.dist.noon : num 0.556 -0.301 0.399 0.187 0.462 ...
## $ cos.dist.noon : num 0.831 0.954 0.917 0.982 0.887 ...
## $ settlements : Factor w/ 2 levels "Far","Near": 1 1 1 2 2 2 1 1 1 2 ...
## $ agriculture : Factor w/ 2 levels "Far","Near": NA NA NA NA NA NA NA NA NA NA ...
## $ dunes : Factor w/ 2 levels "semi-shifting",..: NA NA NA NA NA NA NA NA NA NA ...
## $ habitat : Factor w/ 3 levels "bedouin agriculture",..: NA NA NA NA NA NA NA NA NA NA ...
## $ mean.lon : num 35.1 35.1 35.1 35.1 35.1 ...
## $ mean.lat : num 31.4 31.4 31.4 31.4 31.4 ...
## $ species.richness : num 2 2 4 5 2 2 3 1 2 1 ...
## $ total.abundance : num 2 2 5 9 6 4 3 1 3 1 ...
## $ geom.mean.abundance: num 1 1 1.26 1.38 5 ...
## $ year.count : num 0 0 0 0 0 0 0 0 0 0 ...
## $ year.fct : Factor w/ 8 levels "2014","2015",..: 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "sorted")= chr "unit"
## - attr(*, ".internal.selfref")=<externalptr>
sfar[is.na(settlements) | is.na(year)] # no missing variables
## Empty data.table (0 rows and 23 cols): unit,year,campaign,subunit,site,point_name...
# The relevant predictors are settlements and temporal trend
# Dot plots
sfar.sp.rich.dotplot <- ggplot(data = sfar, aes(x = species.richness, y = site, color = settlements,
label = str_sub(point_name, start = 1, end = 20))) +
geom_point() + geom_line(aes(group = site)) + # ggrepel::geom_text_repel() +
facet_grid(campaign ~ .) + labs(title = 'Reptile Species Richness in the sfar', y = 'Site', x = 'Species Richness',
color = 'Proximity to settlements') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, sfar[, max(species.richness)]),
breaks = seq(0, sfar[, max(species.richness)], by = 1)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
sfar.sp.rich.dotplot
ggsave('Figures/Reptile species richness in the sfar - dotplot.png', plot = sfar.sp.rich.dotplot, scale = 1.25)
## Saving 8.75 x 6.25 in image
sfar.abnd.dotplot <- ggplot(data = sfar, aes(x = total.abundance, y = site, color = settlements,
label = str_sub(point_name, start = 1, end = 20))) +
geom_point() + geom_line(aes(group = site)) + # ggrepel::geom_text_repel() +
facet_grid(campaign ~ .) + labs(title = 'Reptile Total Abundance in the sfar', y = 'Site', x = 'Total Abundance') +
scale_color_manual(values = okabe) + scale_x_continuous(limits = c(0, sfar[, max(total.abundance) + 1]),
breaks = seq(0, sfar[, max(total.abundance) + 1], by = 2)) +
theme_bw() + theme(legend.position = 'bottom',
plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))
sfar.abnd.dotplot
ggsave('Figures/Reptile Total Abundance in the sfar - dotplot.png', plot = sfar.abnd.dotplot, scale = 1.25)
## Saving 8.75 x 6.25 in image
# Plot species richness
ggplot(data = sfar, aes(x = settlements, color = settlements, y = species.richness)) + geom_boxplot() +
geom_jitter(height = 0, width = 0.3) + facet_wrap(. ~ year) + theme_bw()
Settlements and annual differences seem minor. Species richness
models:
# sfar species richness - glmm model selection ----
# Full model, Poisson response
sfar.sp.rich.model.full.Poisson <- glmmTMB(species.richness ~ settlements + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site), family = 'poisson', data = sfar)
summary(sfar.sp.rich.model.full.Poisson) # AIC = 424.2; BIC = 443.7. all predictors are insignificant
## Family: poisson ( log )
## Formula:
## species.richness ~ settlements + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 424.2 443.7 -205.1 410.2 112
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.03716 0.1928
## Number of obs: 119, groups: site, 5
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.07782 0.88059 -0.088 0.930
## settlementsNear 0.13778 0.11897 1.158 0.247
## sin.dist.21.June -0.33552 0.57157 -0.587 0.557
## cos.dist.21.June 0.27484 0.65769 0.418 0.676
## sin.dist.noon -0.04252 0.13973 -0.304 0.761
## cos.dist.noon 0.58467 0.47024 1.243 0.214
cat('PHI = '); deviance(sfar.sp.rich.model.full.Poisson)/df.residual(sfar.sp.rich.model.full.Poisson)
## PHI =
## [1] 0.7764989
drop1(sfar.sp.rich.model.full.Poisson) # Can drop sin.dist.noon
## Single term deletions
##
## Model:
## species.richness ~ settlements + sin.dist.21.June + cos.dist.21.June +
## sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 424.22
## settlements 1 423.56
## sin.dist.21.June 1 422.57
## cos.dist.21.June 1 422.39
## sin.dist.noon 1 422.31
## cos.dist.noon 1 423.83
PHI < 1 so we proceed with Poisson models. We can drop sine diel pattern.
sfar.sp.rich.model1 <- glmmTMB(species.richness ~ settlements + sin.dist.21.June + cos.dist.21.June + cos.dist.noon + (1|site), family = 'poisson', data = sfar)
summary(sfar.sp.rich.model1)
## Family: poisson ( log )
## Formula:
## species.richness ~ settlements + sin.dist.21.June + cos.dist.21.June +
## cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 422.3 439.0 -205.2 410.3 113
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.03821 0.1955
## Number of obs: 119, groups: site, 5
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.03021 0.86867 -0.035 0.972
## settlementsNear 0.13475 0.11858 1.136 0.256
## sin.dist.21.June -0.30106 0.56018 -0.537 0.591
## cos.dist.21.June 0.23403 0.64436 0.363 0.716
## cos.dist.noon 0.58325 0.47131 1.238 0.216
drop1(sfar.sp.rich.model1) # Can drop sin.dist.noon
## Single term deletions
##
## Model:
## species.richness ~ settlements + sin.dist.21.June + cos.dist.21.June +
## cos.dist.noon + (1 | site)
## Df AIC
## <none> 422.31
## settlements 1 421.61
## sin.dist.21.June 1 420.60
## cos.dist.21.June 1 420.44
## cos.dist.noon 1 421.91
We can drop also cosine seasonality:
sfar.sp.rich.model2 <- glmmTMB(species.richness ~ settlements + sin.dist.21.June + cos.dist.noon + (1|site), family = 'poisson', data = sfar)
summary(sfar.sp.rich.model2)
## Family: poisson ( log )
## Formula:
## species.richness ~ settlements + sin.dist.21.June + cos.dist.noon +
## (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 420.4 434.3 -205.2 410.4 114
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.04575 0.2139
## Number of obs: 119, groups: site, 5
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.2413 0.4409 0.547 0.584
## settlementsNear 0.1363 0.1185 1.150 0.250
## sin.dist.21.June -0.1196 0.2481 -0.482 0.630
## cos.dist.noon 0.5679 0.4700 1.208 0.227
drop1(sfar.sp.rich.model2) # Can drop sin.dist.noon
## Single term deletions
##
## Model:
## species.richness ~ settlements + sin.dist.21.June + cos.dist.noon +
## (1 | site)
## Df AIC
## <none> 420.44
## settlements 1 419.77
## sin.dist.21.June 1 418.68
## cos.dist.noon 1 419.97
We can drop also sine seasonality:
sfar.sp.rich.model3 <- glmmTMB(species.richness ~ settlements + cos.dist.noon + (1|site), family = 'poisson', data = sfar)
summary(sfar.sp.rich.model3)
## Family: poisson ( log )
## Formula: species.richness ~ settlements + cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 418.7 429.8 -205.3 410.7 115
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.04124 0.2031
## Number of obs: 119, groups: site, 5
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.3031 0.4174 0.726 0.468
## settlementsNear 0.1394 0.1181 1.180 0.238
## cos.dist.noon 0.6028 0.4615 1.306 0.191
drop1(sfar.sp.rich.model3)
## Single term deletions
##
## Model:
## species.richness ~ settlements + cos.dist.noon + (1 | site)
## Df AIC
## <none> 418.68
## settlements 1 418.08
## cos.dist.noon 1 418.48
We can further drop the distance to settlements:
sfar.sp.rich.model4 <- glmmTMB(species.richness ~ cos.dist.noon + (1|site), family = 'poisson', data = sfar)
summary(sfar.sp.rich.model4)
## Family: poisson ( log )
## Formula: species.richness ~ cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 418.1 426.4 -206.0 412.1 116
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.04084 0.2021
## Number of obs: 119, groups: site, 5
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.2770 0.4188 0.662 0.508
## cos.dist.noon 0.7137 0.4540 1.572 0.116
drop1(sfar.sp.rich.model4)
## Single term deletions
##
## Model:
## species.richness ~ cos.dist.noon + (1 | site)
## Df AIC
## <none> 418.08
## cos.dist.noon 1 418.72
We can drop the last fixed predictor:
sfar.sp.rich.model.null <- glmmTMB(species.richness ~ (1|site), family = 'poisson', data = sfar)
summary(sfar.sp.rich.model.null)
## Family: poisson ( log )
## Formula: species.richness ~ (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 418.7 424.3 -207.4 414.7 117
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.04313 0.2077
## Number of obs: 119, groups: site, 5
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.9083 0.1101 8.252 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.sp.rich.model.null)
## Single term deletions
##
## Model:
## species.richness ~ (1 | site)
## Df AIC
## [1,] 418.72
We are now by definition cannot drop any more predictors, as we insist on keeping the site predictor no matter what AIC suggests.
# The chosen model is the null model
sfar.sp.rich.sim.res <- simulateResiduals(sfar.sp.rich.model.null)
plot(sfar.sp.rich.sim.res) # No detected problems
testDispersion(sfar.sp.rich.sim.res)
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.79476, p-value = 0.256
## alternative hypothesis: two.sided
testDispersion(sfar.sp.rich.sim.res, alternative = 'less', plot = F)
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 0.79476, p-value = 0.128
## alternative hypothesis: less
plot(sfar.sp.rich.sim.res$fittedPredictedResponse, sfar.sp.rich.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nSfar species richness null model')
plot(fitted(sfar.sp.rich.model.null), residuals(sfar.sp.rich.model.null), main = 'Response scale residuals\nSfar species richness null model')
# Export these graphs:
png('Analysis/Model diagnostics/Sfar species richness null model QQ Plot.png')
plot(sfar.sp.rich.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Sfar species richness null model fitted vs. scaled residuals.png')
plot(sfar.sp.rich.sim.res$fittedPredictedResponse, sfar.sp.rich.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nSfar species richness null model')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Sfar species richness null model fitted vs. residuals.png')
plot(fitted(sfar.sp.rich.model.null), residuals(sfar.sp.rich.model.null), main = 'Response scale residuals\nSfar species richness null model')
dev.off()
## png
## 2
file.remove('Analysis/sfar - species richness model selection.txt')
## [1] TRUE
for (model in c(ls()[grep('*sfar.sp.rich.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/sfar - species richness model selection.txt', append = T)
}
# load('Analysis/sfar - Species richness models.Rdata')
save(list = ls()[grep('*sfar.sp.rich.model', ls())], file = 'Analysis/Sfar - Species richness models.Rdata')
capture.output(cat('The best fitting model for species richness in the sfar is sfar.sp.rich.model.null.'),
summary(sfar.sp.rich.model.null), file = 'Output/sfar species richness - best fitting model.txt', append = F)
# Create a table comparing total abundance models:
for(model in ls()[grep('*sfar.sp.rich.model.', ls())]){
sp.rich.comparison <- rbind(sp.rich.comparison,
data.table(unit = 'sfar', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
sp.rich.comparison <- sp.rich.comparison[!(formula %like% '~' | formula %like% 'species.richness')] # remove redundant rows
sp.rich.comparison <- unique(sp.rich.comparison)
setorder(sp.rich.comparison, unit, AIC) # Sort by AIC (ascending)
sp.rich.comparison[unit == 'sfar', .(model, family, formula, no.of.preds, AIC, BIC)] # View the table
## model family
## 1: sfar.sp.rich.model4 poisson
## 2: sfar.sp.rich.model3 poisson
## 3: sfar.sp.rich.model.null poisson
## 4: sfar.sp.rich.model2 poisson
## 5: sfar.sp.rich.model1 poisson
## 6: sfar.sp.rich.model.full.Poisson poisson
## formula
## 1: cos.dist.noon + (1 | site)
## 2: settlements + cos.dist.noon + (1 | site)
## 3: (1 | site)
## 4: settlements + sin.dist.21.June + cos.dist.noon + (1 | site)
## 5: settlements + sin.dist.21.June + cos.dist.21.June + cos.dist.noon + (1 | site)
## 6: settlements + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## no.of.preds AIC BIC
## 1: 1 418.0766 426.4139
## 2: 2 418.6797 429.7962
## 3: 0 418.7162 424.2745
## 4: 3 420.4432 434.3388
## 5: 4 422.3110 438.9858
## 6: 5 424.2185 443.6724
write_excel_csv(sp.rich.comparison, file = 'Analysis/Species richness models of reptiles - AIC comparison.csv')
rm(list = setdiff(ls()[grep('*sfar.sp.rich.model', ls())], c('sfar.sp.rich.model.null'))) # Clean up
Again, no researcher hypotheses were supported, so let’s move on to total abundance.
ggplot(data = sfar, aes(x = settlements, y = total.abundance, color = settlements)) + geom_boxplot() + facet_wrap(. ~ year)
2018-2020 seem higher than 2014.
# Full model, Poisson response
sfar.abnd.model.full.Poisson <- glmmTMB(total.abundance ~ year.count * settlements + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site) , family = 'poisson', data = sfar)
summary(sfar.abnd.model.full.Poisson) # AIC = 524.6 BIC = 549.6. seasonality and trend are significant
## Family: poisson ( log )
## Formula:
## total.abundance ~ year.count * settlements + sin.dist.21.June +
## cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 524.6 549.6 -253.3 506.6 110
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.02107 0.1451
## Number of obs: 119, groups: site, 5
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.47411 0.97749 -1.508 0.1315
## year.count 0.11014 0.04487 2.454 0.0141 *
## settlementsNear 0.28469 0.17983 1.583 0.1134
## sin.dist.21.June -1.08524 0.57292 -1.894 0.0582 .
## cos.dist.21.June 1.65336 0.78504 2.106 0.0352 *
## sin.dist.noon 0.01381 0.12274 0.113 0.9104
## cos.dist.noon 0.64807 0.41356 1.567 0.1171
## year.count:settlementsNear -0.04566 0.04606 -0.991 0.3216
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat('PHI = '); deviance(sfar.abnd.model.full.Poisson)/df.residual(sfar.abnd.model.full.Poisson)
## PHI =
## [1] 1.458868
drop1(sfar.abnd.model.full.Poisson) # can drop sine diel pattern
## Single term deletions
##
## Model:
## total.abundance ~ year.count * settlements + sin.dist.21.June +
## cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 524.60
## sin.dist.21.June 1 526.57
## cos.dist.21.June 1 527.72
## sin.dist.noon 1 522.61
## cos.dist.noon 1 525.16
## year.count:settlements 1 523.58
PHI > 1 so we fit a negative binomial model:
sfar.abnd.model.full.NB <- glmmTMB(total.abundance ~ year.count * settlements + sin.dist.21.June + cos.dist.21.June +
sin.dist.noon + cos.dist.noon + (1|site) , family = 'nbinom2', data = sfar)
summary(sfar.abnd.model.full.NB)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count * settlements + sin.dist.21.June +
## cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 518.6 546.4 -249.3 498.6 109
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.002289 0.04784
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 8.32
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.05245 1.13896 -1.802 0.0715 .
## year.count 0.12670 0.05097 2.486 0.0129 *
## settlementsNear 0.27446 0.21239 1.292 0.1963
## sin.dist.21.June -1.28679 0.65251 -1.972 0.0486 *
## cos.dist.21.June 2.12718 0.90095 2.361 0.0182 *
## sin.dist.noon 0.01322 0.14408 0.092 0.9269
## cos.dist.noon 0.80576 0.49365 1.632 0.1026
## year.count:settlementsNear -0.04260 0.05520 -0.772 0.4403
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.abnd.model.full.NB)
## Single term deletions
##
## Model:
## total.abundance ~ year.count * settlements + sin.dist.21.June +
## cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## Df AIC
## <none> 518.65
## sin.dist.21.June 1 520.58
## cos.dist.21.June 1 522.03
## sin.dist.noon 1 516.65
## cos.dist.noon 1 519.41
## year.count:settlements 1 517.24
AIC is lower (better) than for the Poisson models. We can drop the sine diel pattern:
sfar.abnd.model1 <- glmmTMB(total.abundance ~ year.count * settlements + sin.dist.21.June + cos.dist.21.June + cos.dist.noon + (1|site) , family = 'nbinom2', data = sfar)
summary(sfar.abnd.model1)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count * settlements + sin.dist.21.June +
## cos.dist.21.June + cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 516.7 541.7 -249.3 498.7 110
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.00213 0.04616
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 8.31
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.06828 1.12925 -1.832 0.0670 .
## year.count 0.12660 0.05102 2.481 0.0131 *
## settlementsNear 0.27712 0.21040 1.317 0.1878
## sin.dist.21.June -1.29778 0.64273 -2.019 0.0435 *
## cos.dist.21.June 2.13721 0.89749 2.381 0.0173 *
## cos.dist.noon 0.80924 0.49234 1.644 0.1002
## year.count:settlementsNear -0.04327 0.05473 -0.791 0.4292
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.abnd.model1)
## Single term deletions
##
## Model:
## total.abundance ~ year.count * settlements + sin.dist.21.June +
## cos.dist.21.June + cos.dist.noon + (1 | site)
## Df AIC
## <none> 516.65
## sin.dist.21.June 1 518.74
## cos.dist.21.June 1 520.09
## cos.dist.noon 1 517.46
## year.count:settlements 1 515.28
We can drop the interaction:
sfar.abnd.model2 <- glmmTMB(total.abundance ~ year.count + settlements + sin.dist.21.June + cos.dist.21.June + cos.dist.noon + (1|site) , family = 'nbinom2', data = sfar)
summary(sfar.abnd.model2)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count + settlements + sin.dist.21.June +
## cos.dist.21.June + cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 515.3 537.5 -249.6 499.3 111
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.001809 0.04253
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 8.11
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.99583 1.12579 -1.773 0.0763 .
## year.count 0.10401 0.04203 2.475 0.0133 *
## settlementsNear 0.14305 0.12449 1.149 0.2505
## sin.dist.21.June -1.32742 0.64017 -2.074 0.0381 *
## cos.dist.21.June 2.16994 0.89754 2.418 0.0156 *
## cos.dist.noon 0.76267 0.48883 1.560 0.1187
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.abnd.model2)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + settlements + sin.dist.21.June +
## cos.dist.21.June + cos.dist.noon + (1 | site)
## Df AIC
## <none> 515.28
## year.count 1 518.91
## settlements 1 514.59
## sin.dist.21.June 1 517.59
## cos.dist.21.June 1 518.85
## cos.dist.noon 1 515.79
We can drop the distance to settlements:
sfar.abnd.model3 <- glmmTMB(total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June + cos.dist.noon + (1|site) , family = 'nbinom2', data = sfar)
summary(sfar.abnd.model3)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## cos.dist.noon + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 514.6 534.0 -250.3 500.6 112
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.004549 0.06744
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 7.86
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.98435 1.13219 -1.753 0.0797 .
## year.count 0.09872 0.04229 2.334 0.0196 *
## sin.dist.21.June -1.32625 0.63866 -2.077 0.0378 *
## cos.dist.21.June 2.10294 0.90095 2.334 0.0196 *
## cos.dist.noon 0.88915 0.48171 1.846 0.0649 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.abnd.model3)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## cos.dist.noon + (1 | site)
## Df AIC
## <none> 514.59
## year.count 1 517.78
## sin.dist.21.June 1 517.03
## cos.dist.21.June 1 518.03
## cos.dist.noon 1 516.14
We can drop the cosine diel pattern since delta AIC < 2:
sfar.abnd.model4 <- glmmTMB(total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June + (1|site) , family = 'nbinom2', data = sfar)
summary(sfar.abnd.model4)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 516.1 532.8 -252.1 504.1 113
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.0177 0.133
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 7.87
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.90043 1.01637 -0.886 0.3757
## year.count 0.08767 0.04376 2.003 0.0451 *
## sin.dist.21.June -1.20839 0.64783 -1.865 0.0621 .
## cos.dist.21.June 1.75654 0.93119 1.886 0.0593 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.abnd.model4)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## (1 | site)
## Df AIC
## <none> 516.14
## year.count 1 518.44
## sin.dist.21.June 1 517.94
## cos.dist.21.June 1 518.26
Let’s try to remove sine seasonality as delta AIC < 2 compared to the current model (although not compared to model 3):
sfar.abnd.model5 <- glmmTMB(total.abundance ~ year.count + cos.dist.21.June + (1|site) , family = 'nbinom2', data = sfar)
summary(sfar.abnd.model5)
## Family: nbinom2 ( log )
## Formula: total.abundance ~ year.count + cos.dist.21.June + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 517.9 531.8 -254.0 507.9 114
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.06742 0.2596
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 7.79
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.84236 0.34166 2.466 0.0137 *
## year.count 0.06540 0.03979 1.644 0.1003
## cos.dist.21.June 0.29903 0.42990 0.696 0.4867
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.abnd.model5)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + cos.dist.21.June + (1 | site)
## Df AIC
## <none> 517.94
## year.count 1 518.69
## cos.dist.21.June 1 516.43
Now we can also drop cosine seasonality:
sfar.abnd.model6 <- glmmTMB(total.abundance ~ year.count + (1|site) , family = 'nbinom2', data = sfar)
summary(sfar.abnd.model6)
## Family: nbinom2 ( log )
## Formula: total.abundance ~ year.count + (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 516.4 527.5 -254.2 508.4 115
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.09336 0.3055
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 7.87
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.05305 0.17243 6.107 1.01e-09 ***
## year.count 0.04518 0.02695 1.676 0.0937 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.abnd.model6)
## Single term deletions
##
## Model:
## total.abundance ~ year.count + (1 | site)
## Df AIC
## <none> 516.43
## year.count 1 517.22
Try keeping only the site as a random predictor:
sfar.abnd.model7 <- glmmTMB(total.abundance ~ (1|site) , family = 'nbinom2', data = sfar)
summary(sfar.abnd.model7)
## Family: nbinom2 ( log )
## Formula: total.abundance ~ (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 517.2 525.6 -255.6 511.2 116
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.09306 0.3051
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 7.31
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.1942 0.1499 7.966 1.64e-15 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(sfar.abnd.model7)
## Single term deletions
##
## Model:
## total.abundance ~ (1 | site)
## Df AIC
## [1,] 517.22
Which leaves us with the model 3 with the lowest AIC (delta AIC > 2 compared to model 7), while model 4 is simplier (has fewer predictors) and its AIC is 516.1 (i.e. delta AIC < 2 from the minimal AIC). Although the seasonality is only marginally significant (p < 0.1), we cannot drop it due to delta AIC constraints. Proceed to model diagnostics:
# The chosen model is sfar.abnd.model4 - trend and seasonality
summary(sfar.abnd.model4)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 516.1 532.8 -252.1 504.1 113
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.0177 0.133
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 7.87
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.90043 1.01637 -0.886 0.3757
## year.count 0.08767 0.04376 2.003 0.0451 *
## sin.dist.21.June -1.20839 0.64783 -1.865 0.0621 .
## cos.dist.21.June 1.75654 0.93119 1.886 0.0593 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sfar.abnd.sim.res <- simulateResiduals(sfar.abnd.model4)
plot(sfar.abnd.sim.res) # no problems detected
testDispersion(sfar.abnd.sim.res)
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 1.0225, p-value = 0.896
## alternative hypothesis: two.sided
testDispersion(sfar.abnd.sim.res, alternative = 'less', plot = F)
##
## DHARMa nonparametric dispersion test via sd of residuals fitted vs.
## simulated
##
## data: simulationOutput
## dispersion = 1.0225, p-value = 0.552
## alternative hypothesis: less
plot(sfar.abnd.sim.res$fittedPredictedResponse, sfar.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nSfar total abundance model')
plot(fitted(sfar.sp.rich.model.null), residuals(sfar.sp.rich.model.null), main = 'Response scale residuals\nSfar total abundance model')
# Export these graphs:
png('Analysis/Model diagnostics/Sfar total abundance model QQ Plot.png')
plot(sfar.abnd.sim.res)
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Sfar total abundance model fitted vs. scaled residuals.png')
plot(sfar.abnd.sim.res$fittedPredictedResponse, sfar.abnd.sim.res$scaledResiduals, main = 'DHARMa scaled residuals\nSfar total abundance model')
dev.off()
## png
## 2
png('Analysis/Model diagnostics/Sfar total abundance model fitted vs. residuals.png')
plot(fitted(sfar.sp.rich.model.null), residuals(sfar.sp.rich.model.null), main = 'Response scale residuals\nSfar total abundance model')
dev.off()
## png
## 2
No problems detected. Now we can back up and document the model selection process:
file.remove('Analysis/sfar - total abundance model selection.txt')
## [1] TRUE
for (model in c(ls()[grep('*sfar.abnd.model', ls())])){
capture.output(cat(model), cat('\n=========\n'), summary(get(model)), cat('\n=========\n'),
file = 'Analysis/sfar - total abundance model selection.txt', append = T)
}
# load('Analysis/sfar - Species richness models.Rdata')
save(list = ls()[grep('*sfar.abnd.model', ls())], file = 'Analysis/sfar - total abundance models.Rdata')
capture.output(cat('The best fitting model for total abundance in the sfar is sfar.abnd.model4.'),
summary(sfar.abnd.model4), file = 'Output/sfar total abundance - best fitting model.txt', append = F)
# Create a table comparing total abundance models:
for(model in ls()[grep('*sfar.abnd.model.', ls())]){
total.abnd.comparison <- rbind(total.abnd.comparison,
data.table(unit = 'sfar', model = model,
no.of.preds = length(attr(get(model)$modelInfo$terms$cond$fixed, 'term.labels')),
AIC = AIC(get(model)), BIC = BIC(get(model)),
data = as.character(get(model)$call$data),
family = as.character(get(model)$call$family),
formula = as.character(get(model)$call$formula)))
}
total.abnd.comparison <- total.abnd.comparison[!(formula %like% '~' | formula %like% 'total.abundance')] # remove redundant rows
total.abnd.comparison <- unique(total.abnd.comparison)
setorder(total.abnd.comparison, unit, AIC) # Sort by AIC (ascending)
total.abnd.comparison[unit == 'sfar', .(model, family, formula, no.of.preds, AIC, BIC)] # View the table
## model family
## 1: sfar.abnd.model3 nbinom2
## 2: sfar.abnd.model2 nbinom2
## 3: sfar.abnd.model4 nbinom2
## 4: sfar.abnd.model6 nbinom2
## 5: sfar.abnd.model1 nbinom2
## 6: sfar.abnd.model7 nbinom2
## 7: sfar.abnd.model5 nbinom2
## 8: sfar.abnd.model.full.NB nbinom2
## 9: sfar.abnd.model.full.Poisson poisson
## formula
## 1: year.count + sin.dist.21.June + cos.dist.21.June + cos.dist.noon + (1 | site)
## 2: year.count + settlements + sin.dist.21.June + cos.dist.21.June + cos.dist.noon + (1 | site)
## 3: year.count + sin.dist.21.June + cos.dist.21.June + (1 | site)
## 4: year.count + (1 | site)
## 5: year.count * settlements + sin.dist.21.June + cos.dist.21.June + cos.dist.noon + (1 | site)
## 6: (1 | site)
## 7: year.count + cos.dist.21.June + (1 | site)
## 8: year.count * settlements + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## 9: year.count * settlements + sin.dist.21.June + cos.dist.21.June + sin.dist.noon + cos.dist.noon + (1 | site)
## no.of.preds AIC BIC
## 1: 4 514.5933 534.0471
## 2: 5 515.2767 537.5097
## 3: 3 516.1432 532.8179
## 4: 1 516.4294 527.5459
## 5: 6 516.6540 541.6661
## 6: 0 517.2177 525.5551
## 7: 2 517.9412 531.8368
## 8: 7 518.6455 546.4368
## 9: 7 524.5986 549.6107
write_excel_csv(total.abnd.comparison, file = 'Analysis/Total abundance models of reptiles - AIC comparison.csv')
rm(list = setdiff(ls()[grep('*sfar.abnd.model', ls())], c('sfar.abnd.model4'))) # Clean up
This time the trend is significant, so let’s explore the model’s predictions:
# sfar - predict reptile total abundance----
summary(sfar.abnd.model4)
## Family: nbinom2 ( log )
## Formula:
## total.abundance ~ year.count + sin.dist.21.June + cos.dist.21.June +
## (1 | site)
## Data: sfar
##
## AIC BIC logLik deviance df.resid
## 516.1 532.8 -252.1 504.1 113
##
## Random effects:
##
## Conditional model:
## Groups Name Variance Std.Dev.
## site (Intercept) 0.0177 0.133
## Number of obs: 119, groups: site, 5
##
## Dispersion parameter for nbinom2 family (): 7.87
##
## Conditional model:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.90043 1.01637 -0.886 0.3757
## year.count 0.08767 0.04376 2.003 0.0451 *
## sin.dist.21.June -1.20839 0.64783 -1.865 0.0621 .
## cos.dist.21.June 1.75654 0.93119 1.886 0.0593 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Predict by the mean observed values
sfar[, sort(unique(unit))]
## [1] Mediterranean-Desert Transition Zone
## 5 Levels: Coastal Plain Sands ... Planted Conifer Forests
# Create a table to be filled by a loop with predictor values to be used for predictions
sfar[, sort(unique(year))] # 2014-2020
## [1] 2014 2016 2018 2020
sfar.total.abnd.fit.data <- data.table(expand.grid(year.count = sfar[, sort(unique(year.count))], site = NA,
dist.21.June.radians = reptiles[unit == 'Mediterranean-Desert Transition Zone',
.(dist.21.June.radians = unique(dist.21.June.radians)),
keyby = survey_ID][, mean(dist.21.June.radians)],
dist.noon.radians = reptiles[unit == 'Mediterranean-Desert Transition Zone',
.(dist.noon.radians = unique(dist.noon.radians)),
keyby = survey_ID][, mean(dist.noon.radians)]))
sfar.total.abnd.fit.data[, ':=' (year = year.count + sfar[, min(year)],
cos.dist.21.June = cos(dist.21.June.radians), sin.dist.21.June = sin(dist.21.June.radians),
cos.dist.noon = cos(dist.noon.radians))]
setorder(sfar.total.abnd.fit.data, year.count)
sfar.total.abnd.fit.data # seems ok
## year.count site dist.21.June.radians dist.noon.radians year cos.dist.21.June
## 1: 0 NA -0.9826563 0.05800653 2014 0.5548145
## 2: 2 NA -0.9826563 0.05800653 2016 0.5548145
## 3: 4 NA -0.9826563 0.05800653 2018 0.5548145
## 4: 6 NA -0.9826563 0.05800653 2020 0.5548145
## sin.dist.21.June cos.dist.noon
## 1: -0.8319741 0.9983181
## 2: -0.8319741 0.9983181
## 3: -0.8319741 0.9983181
## 4: -0.8319741 0.9983181
bla <- predict(sfar.abnd.model4, newdata = sfar.total.abnd.fit.data, type = 'response', se.fit = T)
sfar.total.abnd.fit.data[, ':=' (predicted.abnd = bla$fit, predicted.abnd.se = bla$se.fit)]
sfar.total.abnd.fit.data[, .(year, predicted.abnd, predicted.abnd.se)] # From 2.9 in 2014 to 5.0 individuals in 2020
## year predicted.abnd predicted.abnd.se
## 1: 2014 2.943123 0.4155394
## 2: 2016 3.507205 0.3839593
## 3: 2018 4.179400 0.5814608
## 4: 2020 4.980429 1.0212481
5.0 / 2.9 - 1 # 72.4% more
## [1] 0.7241379
write_excel_csv(sfar.total.abnd.fit.data[, .(year, predicted.abnd, predicted.abnd.se)], 'Output/Sfar - predicted reptile total abundance.csv')
sfar.total.abnd.fake.effect.plot <- ggplot(data = sfar.total.abnd.fit.data, aes(x = year, y = predicted.abnd)) +
# geom_jitter(data = sfar, aes(x = year, y = total.abundance), alpha = 0.25, color = '#4e79b6', width = 0.2, height = 0.1) +
geom_ribbon(aes(x = year, ymin = predicted.abnd - 1.96*predicted.abnd.se, ymax = predicted.abnd + 1.96*predicted.abnd.se),
alpha = 0.25, color = NA) + labs(x = NULL, y = strReverse('שפע כולל')) + # geom_hline(yintercept = 0) +
geom_line(linewidth = 1) + # geom_smooth(method = 'glm', se = T) +
theme_minimal() + theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom',
text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major.y = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.minor.x = element_blank(), panel.grid.major.x = element_blank())
sfar.total.abnd.fake.effect.plot # Seems pretty ridiculous, in fact
Cairo::Cairo(file = "Figures/sfar total abundance fake effect plot.pdf", width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(sfar.total.abnd.fake.effect.plot)
dev.off()
## png
## 2
# Plot the temporal trend:
sfar.abnd.effect_plot <- effect_plot(model = sfar.abnd.model4, partial.residuals = F, point.size = 3,
pred = year.count, data = sfar, colors = "Qual1", point.alpha = 0.25,
plot.points = F, jitter = c(0.1,0), int.type = 'confidence', line.colors = "black",
legend.main = strReverse('שנה'), pred.labels = 2014:2020) +
theme_minimal() + theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5), legend.position = 'bottom',
text = element_text(family = fontname, size = fontsize), axis.text = element_text(size = fontsize - 1),
panel.grid.major.y = element_line(color = 'grey90', linetype = 5, linewidth = 1),
panel.grid.minor = element_blank(), panel.grid.minor.x = element_blank(), panel.grid.major.x = element_blank()) +
# scale_y_continuous(limits = c(0, 8), breaks = 0:8) +
scale_x_continuous(breaks = sfar[, sort(unique(year.count))], labels = sfar[, .(year = unique(year)), keyby = year.count][, year]) +
labs(x = NULL, y = strReverse('שפע כולל'))
## Warning in check_dots(..., .action = "warning"): unknown arguments: interval
sfar.abnd.effect_plot # The prediction seems reasonable
Cairo::Cairo(file = 'Figures/sfar abundance temporal trend effect plot.pdf', width = pdf_width, height = pdf_width*pdf_aspect_ratio,
type = "PDF", units = "mm")
print(sfar.abnd.effect_plot)
dev.off()
## png
## 2
And that’s all, folks!